Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP Sessions users being logged out
    text
    copied!<p>I'm having trouble with a PHP website which requires users to be logged in to access all content other than the home page and a couple of static pages (about us, contact us etc.). Several users have said they are being logged out every few minutes whilst using the site - they can login but will be shown the login form again after a few minutes. I can't confirm this myself as the site seems to work fine for me - even using the same browser as they are and under their accounts - but I'm wondering if this could be a problem with the session settings?</p> <p>According to phpinfo(), the session configuration values are:</p> <pre><code>session.auto_start = Off session.bug_compat_42 = On session.bug_compat_warn = On session.cache_expire = 180 session.cache_limiter = nocache session.cookie_domain = no value session.cookie_httponly = Off session.cookie_lifetime = 0 session.cookie_path = / session.cookie_secure = Off session.entropy_file = no value session.entropy_length = 0 session.gc_divisor = 100 session.gc_maxlifetime = 1440 session.gc_probability = 1 session.hash_bits_per_character = 4 session.hash_function = 0 session.name = PHPSESSID session.referer_check = no value session.save_handler = files session.save_path = /shared/sessions session.serialize_handler = php session.use_cookies = On session.use_only_cookies = Off session.use_trans_sid = 0 </code></pre> <p>Is there anything obviously wrong with the above settings which could be causing users to be regularly logged out? session.gc_maxlifetime looks a bit low, but 1440 seconds is still 24 minutes and users are being logged out more regularly than that. We don't check the user's IP as part of the session handling, although the office has a static IP address anyway.</p> <p>This is on a Debian Lenny server, PHP 5.2.6 and Apache 2.2.9.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload