Jump to content

Sessions Expiring Early


smashbugs

Recommended Posts

Hi everyone, I have a site where the users log in with their username and password, and it stores their info in a session. If the session variables are not detected, the pages will send them to the login page.

 

For some reason, users are randomly getting logged out after even 20 minutes of inactivity in some cases. I have to figure this out, but I just can't seem to put a finger on it. Here is my phpinfo() on sessions:

 

session
Session Support 	enabled
Registered save handlers 	files user sqlite
Registered serializer handlers 	php php_binary wddx

Directive	Local Value	Master Value
session.auto_start	Off	Off
session.bug_compat_42	On	On
session.bug_compat_warn	On	On
session.cache_expire	180	180
session.cache_limiter	nocache	nocache
session.cookie_domain	no value	no value
session.cookie_httponly	Off	Off
session.cookie_lifetime	0	0
session.cookie_path	/	/
session.cookie_secure	Off	Off
session.entropy_file	no value	no value
session.entropy_length	0	0
session.gc_divisor	100	100
session.gc_maxlifetime	72000	72000
session.gc_probability	1	1
session.hash_bits_per_character	4	4
session.hash_function	0	0
session.name	PHPSESSID	PHPSESSID
session.referer_check	no value	no value
session.save_handler	files	files
session.save_path	no value	no value
session.serialize_handler	php	php
session.use_cookies	On	On
session.use_only_cookies	Off	Off
session.use_trans_sid	0	0

 

The login page, if the username/pass are correct, just sets their info (ex. username and account ID) as a session variable, ex. $_SESSION['user_id']. Pages detect this with isset($_SESSION['user_id']).

 

And I just cannot figure out why some people get logged out. It doesn't happen every time -- for instance, I can leave it up for five hours and still be okay.

 

Any help would be MUCH appreciated. Thanks!

Link to comment
https://forums.phpfreaks.com/topic/70213-sessions-expiring-early/
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.