|
dolibarr 25.0.0-alpha
|
Set function handlers for PHP session management in DB. More...
Go to the source code of this file.
Functions | |
| dolSessionOpen ($save_path, $session_name) | |
| The session open handler called by PHP whenever a session is initialized. | |
| dolSessionRead ($sess_id) | |
| This function is called whenever a session_start() call is made and reads the session variables. | |
| dolSessionWrite ($sess_id, $val) | |
| This function is called when a session is initialized with a session_start( ) call, when variables are registered or unregistered, and when session variables are modified. | |
| dolSessionClose () | |
| This function is executed on shutdown of the session. | |
| dolSessionDestroy ($sess_id) | |
| This is called whenever the session_destroy() function call is made. | |
| dolSessionGC ($max_lifetime) | |
| This function is called on a session's start up with the probability specified in session.gc_probability. | |
| dolSessionsLimitForUser ($fk_user, $keepcount, $currentsessionid) | |
| Enforce a maximum number of concurrent database sessions for a given user. | |
| dolListSessions () | |
| List sessions in db. | |
Set function handlers for PHP session management in DB.
Definition in file phpsessionindb.lib.php.
| dolListSessions | ( | ) |
List sessions in db.
Definition at line 355 of file phpsessionindb.lib.php.
References dol_now().
Referenced by listOfSessions().
| dolSessionClose | ( | ) |
This function is executed on shutdown of the session.
Definition at line 224 of file phpsessionindb.lib.php.
| dolSessionDestroy | ( | $sess_id | ) |
This is called whenever the session_destroy() function call is made.
Returns true if the session has successfully been deleted.
| string | $sess_id | Session iDecodeStream |
Definition at line 241 of file phpsessionindb.lib.php.
| dolSessionGC | ( | $max_lifetime | ) |
This function is called on a session's start up with the probability specified in session.gc_probability.
Performs garbage collection by removing all sessions that haven't been updated in the last $max_lifetime seconds as set in session.gc_maxlifetime.
| int | $max_lifetime | Max lifetime |
Definition at line 261 of file phpsessionindb.lib.php.
References dol_now(), and dol_syslog().
Referenced by dolSessionWrite().
| dolSessionOpen | ( | $save_path, | |
| $session_name ) |
The session open handler called by PHP whenever a session is initialized.
| string | $save_path | Value of session.save_path into php.ini |
| string | $session_name | Session name (Example: 'DOLSESSID_xxxxxx') |
Definition at line 42 of file phpsessionindb.lib.php.
References getDoliDBInstance().
| dolSessionRead | ( | $sess_id | ) |
This function is called whenever a session_start() call is made and reads the session variables.
| string | $sess_id | Session ID |
Definition at line 82 of file phpsessionindb.lib.php.
References dol_now().
| dolSessionsLimitForUser | ( | $fk_user, | |
| $keepcount, | |||
| $currentsessionid ) |
Enforce a maximum number of concurrent database sessions for a given user.
Called when a new authenticated session is being established. The existing rows of that user in llx_session are kept only for the ($keepcount - 1) most recently accessed ones, so that adding the session being established brings the total back to $keepcount. The other (older) sessions are deleted, which logs those browsers out on their next request (dolSessionRead() then finds no row).
| int | $fk_user | Id of the user that just logged in |
| int | $keepcount | Max number of concurrent sessions for this user (<= 0 disables the feature) |
| string | $currentsessionid | Id of the session being established (never deleted) |
Definition at line 293 of file phpsessionindb.lib.php.
References dol_syslog().
| dolSessionWrite | ( | $sess_id, | |
| $val ) |
This function is called when a session is initialized with a session_start( ) call, when variables are registered or unregistered, and when session variables are modified.
Returns true on success.
| string | $sess_id | Session iDecodeStream |
| string | $val | Content of session |
Definition at line 135 of file phpsessionindb.lib.php.
References dol_now(), dolSessionGC(), getDolGlobalInt(), and getUserRemoteIP().