Forum
Members App Logging the user out on page change
Hey Perch Community,
I have a simple login page with the following code:
<perch:member logged-in="true">
<p class="light green">Hi <perch:member id="first_name" />, you are logged in</p>
<a href="#" class="bold grey">A Link</a>
<a href="#" class="bold grey">Another Link</a>
<!-- Perch Form Goes Here -->
</perch:member>
The login works great and displays the content under
logged-in="true"
My question is...
Why is it, that after a user is logged in. Upon visiting another page, the user is automatically logged out?
Is there a PHP script that I need to include on other pages to keep the user logged in?
I'm using the following to detect:
<?php
if (perch_member_logged_in()) {
echo '<li class="bold location">Welcome back, '.perch_member_get('first_name').'!</li>';
}else{
echo '<p class="light grey">You are not logged in. Please <a href="index.php">Login</a>.</p>';
}
?>
Matthew,
This is not a normal issue with perch members. It sounds as if php sessions may not be working properly on your server. Does this happen to you as well using a test member account.