Hi,
I am using Weblogin (to login) and WebloginPE (to signup) on my site to allow users to sign-in to view certain pages - Is it possible to extend the default session length to be longer than the default?
Thanks guys.
dubbs
-
☆ A M B ☆
- 24,524 Posts
No. This is purely a function of the server configuration.
The MODx Manager deals with this by using a bit of javascript to request an image every few minutes, so the session never times out as long as the browser window is open.
Well, it is possible to reset this with session.gc_maxlifetime, but there is a caveat when using shared hosting:
Note: If different scripts have different values of session.gc_maxlifetime but share the same place for storing the session data then the script with the minimum value will be cleaning the data. In this case, use this directive together with session.save_path.
I have done this on a site with a very short session lifetime, but setting a session_save_path other than the default means that the automatic PHP garbage collection (which is using the above mentioned minimum value) will never occur for your custom session file location, leading to an overflowing session directory. I had to make up my own garbage collection function in a plugin that basically emulated the PHP function.
http://www.php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime
http://www.php.net/manual/en/function.session-save-path.php