SessionHandlerInterface
interface SessionHandlerInterface (View source)
SessionHandlerInterface is an interface which defines a prototype for creating a custom session handler.
In order to pass a custom session handler to session_set_save_handler() using its OOP invocation, the class must implement this interface.
Methods
bool
close()
Close the session
bool
destroy(string $id)
Destroy a session
int|false
gc(int $max_lifetime)
Cleanup old sessions
bool
open(string $path, string $name)
Initialize session
string|false
read(string $id)
Read session data
bool
write(string $id, string $data)
Write session data
Details
bool
close()
Since: 5.4
Close the session
bool
destroy(string $id)
Since: 5.4
Destroy a session
int|false
gc(int $max_lifetime)
Since: 5.4
Cleanup old sessions
bool
open(string $path, string $name)
Since: 5.4
Initialize session
string|false
read(string $id)
Since: 5.4
Read session data
bool
write(string $id, string $data)
Since: 5.4
Write session data