Session
in package
implements
SessionHandler
Implement session handler
This class provides interfaces for session handling. It is used to register a redis cache based session save handler.
Class override the local php session handler this class handles all system sessions including garbage collection. It is either a plain file system session or, if possible a apc session.
This handler can either use an cookie based handling like php default and a handler based on oauth tokens.
Tags
Interfaces, Classes, Traits and Enums
- SessionHandler
- Define a session handler interface with start and end points
Table of Contents
- $host : string|null
- __construct() : mixed
- Init session and setup internal properties this will also set the cookie params
- close() : bool
- Required method
- destroy() : bool
- Destroy session Unset session on logout
- End() : void
- GarbageCollect() : bool
- Do garbage collect Empty but required interface for session handler
- open() : bool
- Required method to start the session
- read() : mixed|string
- Read values
- Start() : void
- write() : bool
- Write session
Properties
$host
private
string|null
$host
Methods
__construct()
Init session and setup internal properties this will also set the cookie params
public
__construct(string|null $host) : mixed
Parameters
- $host : string|null
Return values
mixed —close()
Required method
public
close() : bool
Return values
bool —destroy()
Destroy session Unset session on logout
public
destroy(string $id) : bool
Parameters
- $id : string
-
The session to delete
Return values
bool —True when delete worked
End()
public
End(Response $response) : void
Parameters
- $response : Response
Return values
void —GarbageCollect()
Do garbage collect Empty but required interface for session handler
public
GarbageCollect(int $max_life_time) : bool
Parameters
- $max_life_time : int
-
The maximum session life time
Return values
bool —open()
Required method to start the session
public
open( $path, $name) : bool
Parameters
Return values
bool —read()
Read values
public
read( $id) : mixed|string
Parameters
Return values
mixed|string —Start()
public
Start(Request $request) : void
Parameters
- $request : Request
Return values
void —write()
Write session
public
write( $id, $data) : bool