Jump to content

Login integration problem


dal

Recommended Posts

I'm using the following code on my home page to display custom content to users who are logged in on the forum:

$framework_url = 'forum/init.php';

require_once($framework_url);

\IPS\Session\Front::i();
$member = \IPS\Member::loggedIn();

if ($member->member_group_id == $a) {
    //Show member stuff
} else {
    //Show guest stuff
}

When a user visits the forum and then goes to the home page the code correctly reports that the user is logged in, however if a user goes away for a while so that their session expires and then returns to the home page, the code is reporting that they are logged out, even though a visit to the forum afterwards will show that they are actually still logged in.

How do I get the above code to recognize that a user is logged in (like the forum does) even if their immediate session has expired ?

Thank you.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...