Forum
Members not staying logged in following update to Runway and Members 1.4
I've upgraded a Perch site to the latest versions of Runway and Members 1.4. Now, if I log in with a member email/pass, I am able to view a page utilizing perch_member_logged_in()
, but if I try to navigate to another members-only page, I'm asked for my email/pass again. In other words, it appears members aren't staying logged in.
Here is an example page using perch_member_logged_in()
:
<?php
include('regents-admin/runtime.php');
// $page_head_scripts = <<<PHS
// <script type="text/javascript"></script>
// PHS;
// $page_footer_scripts = <<<PFS
// <script type="text/javascript"></script>
// PFS;
?>
<?php
if (perch_member_logged_in()) {
define('PAGE_TITLE',perch_pages_title(true));
define('PAGE_BODY_ID','gold-first');
include('_header.php');
include('_community-nav.php');
// PAGE START
?>
<?php perch_content('Text Sections'); ?>
<?php
include('_footer.php');
}else{
PerchSystem::set_page('/' . pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME));
define('PAGE_TITLE','Login');
define('PAGE_BODY_ID','loginBody');
include('_header.php');
perch_members_login_form();
?>
<script type="text/javascript" src="/js/infieldlabels.js?v=2015012501"></script>
<script type="text/javascript">
$("label").inFieldLabels();
</script>
</body>
</html>
<?php
}
?>
when i'm logged out and presented with the login form, this is what debug shows:
Debug Message
SELECT * FROM perch2_pages WHERE pagePath='/classroom-content' LIMIT 1
SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
Using template: /templates/members/login/login_form.html
and here is diagnostics:
SUMMARY INFORMATION
Perch Runway: 2.8.20, PHP: 5.6.14-1+deb.sury.org~trusty+1, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $, with PDO
Server OS: Linux, apache2handler
Installed apps: content (2.8.20), assets (2.8.20), categories (2.8.20), perch_blog (5.0), perch_members (1.4)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_members', );
PERCH_LOGINPATH: /regents-admin
PERCH_PATH: /var/www/public/regents.dev/regents-admin
PERCH_CORE: /var/www/public/regents.dev/regents-admin/core
PERCH_RESFILEPATH: /var/www/public/regents.dev/regents-admin/resources
Image manipulation: GD Imagick
PHP limits: Max upload 100M, Max POST 100M, Memory: 128M, Total max file upload: 100M
Resource folder writeable: Yes
HTTP_HOST: regents.dev
DOCUMENT_ROOT: /var/www/public/regents.dev
REQUEST_URI: /regents-admin/core/settings/diagnostics/
SCRIPT_NAME: /regents-admin/core/settings/diagnostics/index.php
It looks like you're not using routing, is that correct? If so, you might need a newer version of Members than the one you have.
Yes, this site is in the hybrid Perch/Runway state. It looks like Members 1.4 is the latest version? Here's my htaccess:
Members 1.4 is the newest available version, but it's not the newest version. It's quite old now (August, I think).
I'll see if there's an update we can ship.
Great, thanks Drew. This is the only thing keeping me from going live with the Runway upgrade, so a fix would be much appreciated!
Ok, give 1.4.2 a try.
That fixed it, thanks Drew!