Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezpsessionhandlerphp.php
Go to the documentation of this file.
1 <?php
19 class ezpSessionHandlerPHP extends ezpSessionHandler
20 {
25 public function setSaveHandler()
26 {
27 $ini = eZINI::instance();
28 if ( $ini->hasVariable('Session', 'SessionTimeout') && $ini->variable('Session', 'SessionTimeout') )
29 {
30 ini_set("session.gc_maxlifetime", $ini->variable('Session', 'SessionTimeout') );
31 }
32 // make sure eZUser does not update lastVisit on every request and only on login
33 $GLOBALS['eZSessionIdleTime'] = 0;
34 return true;
35 }
36
40 public function read( $sessionId )
41 {
42 return false;
43 }
44
48 public function write( $sessionId, $sessionData )
49 {
50 return false;
51 }
52
53 public function destroy( $sessionId )
54 {
55 $_SESSION = array();
56 session_destroy();
57
58 ezpEvent::getInstance()->notify( 'session/destroy', array( $sessionId ) );
59 return true;
60 }
61
65 public function regenerate( $updateBackendData = true )
66 {
67 $oldSessionId = session_id();
68 session_regenerate_id( $updateBackendData );
69 $newSessionId = session_id();
70
71 ezpEvent::getInstance()->notify( 'session/regenerate', array( $oldSessionId, $newSessionId ) );
72
73 if ( $updateBackendData )
74 {
75 $db = eZDB::instance();
76 $escOldKey = $db->escapeString( $oldSessionId );
77 $escNewKey = $db->escapeString( $newSessionId );
78 $escUserID = $db->escapeString( eZSession::userID() );
79 eZSession::triggerCallback( 'regenerate_pre', array( $db, $escNewKey, $escOldKey, $escUserID ) );
80 eZSession::triggerCallback( 'regenerate_post', array( $db, $escNewKey, $escOldKey, $escUserID ) );
81 }
82 return true;
83 }
84
88 public function gc( $maxLifeTime )
89 {
90 ezpEvent::getInstance()->notify( 'session/gc', array( $maxLifeTime ) );
91 $db = eZDB::instance();
92 eZSession::triggerCallback( 'gc_pre', array( $db, $maxLifeTime ) );
93 eZSession::triggerCallback( 'gc_post', array( $db, $maxLifeTime ) );
94 return false;
95 }
96
100 public function cleanup()
101 {
102 ezpEvent::getInstance()->notify( 'session/cleanup', array() );
103 $db = eZDB::instance();
104 eZSession::triggerCallback( 'cleanup_pre', array( $db ) );
105 eZSession::triggerCallback( 'cleanup_post', array( $db ) );
106 return true;
107 }
108
112 public function deleteByUserIDs( array $userIDArray )
113 {
114 }
115
119 static public function hasBackendAccess()
120 {
121 return false;
122 }
123
127 static public function dbRequired()
128 {
129 return false;
130 }
131 }
132 ?>
eZSession\userID
static userID()
Definition: lib/ezsession/classes/ezsession.php:547
eZSession\triggerCallback
static triggerCallback( $type, $params)
Definition: lib/ezsession/classes/ezsession.php:641
$ini
$ini
Definition: classes/admin/linklist.php:64
ezpEvent\getInstance
static getInstance()
Definition: ezpevent.php:176
ezpSessionHandlerPHP
Definition: ezpsessionhandlerphp.php:20
ezpSessionHandlerPHP\hasBackendAccess
static hasBackendAccess()
Definition: ezpsessionhandlerphp.php:119
ezpSessionHandlerPHP\cleanup
cleanup()
Definition: ezpsessionhandlerphp.php:100
ezpSessionHandlerPHP\write
write( $sessionId, $sessionData)
Definition: ezpsessionhandlerphp.php:48
ezpSessionHandlerPHP\deleteByUserIDs
deleteByUserIDs(array $userIDArray)
Definition: ezpsessionhandlerphp.php:112
ezpSessionHandlerPHP\read
read( $sessionId)
Definition: ezpsessionhandlerphp.php:40
ezpSessionHandlerPHP\regenerate
regenerate( $updateBackendData=true)
Definition: ezpsessionhandlerphp.php:65
ezpSessionHandlerPHP\setSaveHandler
setSaveHandler()
Definition: ezpsessionhandlerphp.php:25
ezpSessionHandlerPHP\gc
gc( $maxLifeTime)
Definition: ezpsessionhandlerphp.php:88
ezpSessionHandlerPHP\destroy
destroy( $sessionId)
Definition: ezpsessionhandlerphp.php:53
ezpSessionHandlerPHP\dbRequired
static dbRequired()
Definition: ezpsessionhandlerphp.php:127
ezpSessionHandler
Definition: ezpsessionhandler.php:26
$db
$db
Definition: ezarticle/user/authorlist.php:53
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.