PHP PEAR session timeout
This problem is driving me crazy. On two separate projects (both of which use PEAR as libraries, but write on completely different custom frameworks) I am using PEAR Auth for authentication that uses a session.
Once logged in, users log out for an hour or so while in standby mode. I don't have an exact time, but it is very short.
I have tried the following with no success. All attempts to extend the session to one day, just to nail the point at home.
<?php
// Tried built-in methods to extend the idle time, called after Auth is initialised
$auth->setIdle( 86400 );
// Tried increasing the sesion timeout (before auth is called)
ini_set( 'session.gc_maxlifetime', 86400 );
// Tried increasing the cookie timeout (where the phpsession is held, before auth is called)
session_set_cookie_params( 86400 );
// Tried all of the above
?>
Has anyone else had this problem? If so, is it possible to extend the downtime?
I'm just ready to handle PEAR and write my own cookie-based auth class, but I don't really have the time.
source to share
I still haven't encountered this problem, but I see two possible reasons why you haven't figured it out yet:
- You can check the setExpire () method of the auth class in addition to setIdle ().
-
There could be other php based applications / scripts running on the same server using the same session storage directory with less timeout. According to the session.gc_maxlifetime docs:
If different scripts have different session.gc_maxlifetime values, but use the same storage space, then the script with the minimum value will be data. In this case, use this directive together with
session.save_path.
source to share