sessionHandlerInterface
in
Table of Contents
- close() : bool
- Close the session
- destroy() : bool
- Destroy a session
- gc() : bool
- Cleanup old sessions
- open() : bool
- Initialize session
- read() : string
- Read session data
- updateTimestamp() : bool
- Update sesstion modify time.
- write() : bool
- Write session data
Methods
close()
Close the session
public
close() : bool
Tags
Return values
bool —The return value (usually TRUE on success, FALSE on failure). Note this value is returned internally to PHP for processing.
destroy()
Destroy a session
public
destroy(string $session_id) : bool
Parameters
- $session_id : string
-
The session ID being destroyed.
Tags
Return values
bool —The return value (usually TRUE on success, FALSE on failure). Note this value is returned internally to PHP for processing.
gc()
Cleanup old sessions
public
gc(int $maxlifetime) : bool
Parameters
- $maxlifetime : int
-
Sessions that have not updated for the last maxlifetime seconds will be removed.
Tags
Return values
bool —The return value (usually TRUE on success, FALSE on failure). Note this value is returned internally to PHP for processing.
open()
Initialize session
public
open(string $save_path, string $name) : bool
Parameters
- $save_path : string
-
The path where to store/retrieve the session.
- $name : string
-
The session name.
Tags
Return values
bool —The return value (usually TRUE on success, FALSE on failure). Note this value is returned internally to PHP for processing.
read()
Read session data
public
read(string $session_id) : string
Parameters
- $session_id : string
-
The session id to read data for.
Tags
Return values
string —Returns an encoded string of the read data. If nothing was read, it must return an empty string. Note this value is returned internally to PHP for processing.
updateTimestamp()
Update sesstion modify time.
public
updateTimestamp(string $id[, string $data = "" ]) : bool
Parameters
- $id : string
-
session id.
- $data : string = ""
-
session Data.
Tags
Return values
bool —write()
Write session data
public
write(string $session_id, string $session_data) : bool
Parameters
- $session_id : string
-
The session id.
- $session_data : string
-
The encoded session data. This data is the result of the PHP internally encoding the $_SESSION superglobal to a serialized string and passing it as this parameter. Please note sessions use an alternative serialization method.
Tags
Return values
bool —The return value (usually TRUE on success, FALSE on failure). Note this value is returned internally to PHP for processing.