Some users of the site I'm currently developing seem to be having their sessions dropped, and I'm not sure why.
Each page begins with:
ini_set('session.save_handler', 'files');
session_start();
When a user logs in successfully, they get a response message, and the user ID returned from the db is saved in a session variable:
$_SESSION['UserID'] = $result['UserID'];
Then on each page where authentication is required, I do:
if (isset($_SESSION['UserID']))
{
// show the page
}
else
{
// show Not Logged In
}
For most users everything works fine, but for a few users, they cannot stay logged in. As soon as they click off the login page to another page requiring authentication, they get the message that they're not logged in.
I thought ini_set('session.save_handler', 'files') was supposed to take care of this, but maybe not. The site's hosted on Pair Networks (shared), if that makes any difference.
Any ideas?