Open Journal Systems
3.3.0
|
Public Member Functions | |
__construct ($sessionDao, $request) | |
close () | |
destroy ($sessionId) | |
gc ($maxlifetime) | |
getUserSession () | |
open () | |
read ($sessionId) | |
regenerateSessionId () | |
updateSessionCookie ($sessionId=false, $expireTime=0) | |
updateSessionLifetime ($expireTime=0) | |
write ($sessionId, $data) | |
Static Public Member Functions | |
static | getManager () |
Data Fields | |
$sessionDao | |
$userSession | |
Implements PHP methods for a custom session storage handler (see http://php.net/session).
Definition at line 16 of file SessionManager.inc.php.
SessionManager::__construct | ( | $sessionDao, | |
$request | |||
) |
Constructor. Initialize session configuration and set PHP session handlers. Attempts to rejoin a user's session if it exists, or create a new session otherwise.
$sessionDao | SessionDAO |
$request | PKPRequest |
Definition at line 37 of file SessionManager.inc.php.
References $sessionDao, Config\getVar(), and updateSessionLifetime().
SessionManager::close | ( | ) |
Close a session. Does nothing; only here to satisfy PHP session handler requirements.
Definition at line 163 of file SessionManager.inc.php.
SessionManager::destroy | ( | $sessionId | ) |
Destroy (delete) a session.
$sessionId | string |
Definition at line 203 of file SessionManager.inc.php.
SessionManager::gc | ( | $maxlifetime | ) |
Garbage collect unused session data. TODO: Use $maxlifetime instead of assuming 24 hours?
$maxlifetime | int the number of seconds after which data will be seen as "garbage" and cleaned up |
Definition at line 213 of file SessionManager.inc.php.
References Config\getVar().
|
static |
Return an instance of the session manager.
Definition at line 124 of file SessionManager.inc.php.
References $application, Registry\get(), and DAORegistry\getDAO().
Referenced by ReviewerHandler\_validateAccessKey(), RegistrationForm\execute(), PKPLocale\getLocale(), PKPRequest\getSession(), PKPRequest\getUser(), LoginHandler\index(), Validation\isAuthorized(), Validation\isLoggedIn(), Validation\isLoggedInAs(), SubmissionLog\logEvent(), Validation\logout(), SubmissionFileManager\recordView(), Validation\registerUserSession(), APIRouter\route(), PKPPageRouter\route(), and LoginHandler\signIn().
SessionManager::getUserSession | ( | ) |
Get the session associated with the current request.
Definition at line 145 of file SessionManager.inc.php.
References $userSession.
SessionManager::open | ( | ) |
Open a session. Does nothing; only here to satisfy PHP session handler requirements.
Definition at line 154 of file SessionManager.inc.php.
SessionManager::read | ( | $sessionId | ) |
Read session data from database.
$sessionId | string |
Definition at line 172 of file SessionManager.inc.php.
SessionManager::regenerateSessionId | ( | ) |
Regenerate the session ID for the current user session. This is useful to guard against the "session fixation" form of hijacking by changing the user's session ID after they have logged in (in case the original session ID had been pre-populated).
Definition at line 249 of file SessionManager.inc.php.
References updateSessionCookie().
SessionManager::updateSessionCookie | ( | $sessionId = false , |
|
$expireTime = 0 |
|||
) |
Resubmit the session cookie.
$sessionId | string new session ID (or false to keep current ID) |
$expireTime | int new expiration time in seconds (0 = current session) |
Definition at line 223 of file SessionManager.inc.php.
Referenced by regenerateSessionId(), and updateSessionLifetime().
SessionManager::updateSessionLifetime | ( | $expireTime = 0 | ) |
Change the lifetime of the current session cookie.
$expireTime | int new expiration time in seconds (0 = current session) |
Definition at line 270 of file SessionManager.inc.php.
References updateSessionCookie().
Referenced by __construct().
SessionManager::write | ( | $sessionId, | |
$data | |||
) |
Save session data to database.
$sessionId | string |
$data | array |
Definition at line 188 of file SessionManager.inc.php.
object SessionManager::$sessionDao |
The DAO for accessing Session objects
Definition at line 22 of file SessionManager.inc.php.
Referenced by __construct().
object SessionManager::$userSession |
The Session associated with the current request
Definition at line 28 of file SessionManager.inc.php.
Referenced by getUserSession().