BaseHandler
in package
implements
SessionHandlerInterface
uses
LoggerAwareTrait
Base class for session handling
Table of Contents
Interfaces
- SessionHandlerInterface
Properties
- $cookieDomain : string
- Cookie domain
- $cookieName : string
- Cookie name to use
- $cookiePath : string
- Cookie path
- $cookiePrefix : string
- Cookie prefix
- $cookieSecure : bool
- Cookie secure?
- $fingerprint : string
- The Data fingerprint.
- $ipAddress : string
- User's IP address.
- $lock : bool|string
- Lock placeholder.
- $matchIP : bool
- Match IP addresses for cookies?
- $savePath : array<string|int, mixed>|string
- The 'save path' for the session varies between
- $sessionID : string|null
- Current session ID
Methods
- __construct() : mixed
- destroyCookie() : bool
- Internal method to force removal of a cookie by the client when session_destroy() is called.
- fail() : bool
- Drivers other than the 'files' one don't (need to) use the session.save_path INI setting, but that leads to confusing error messages emitted by PHP when open() or write() fail, as the message contains session.save_path ... To work around the problem, the drivers will call this method so that the INI is set just in time for the error message to be properly generated.
- lockSession() : bool
- A dummy method allowing drivers with no locking functionality (databases other than PostgreSQL and MySQL) to act as if they do acquire a lock.
- releaseLock() : bool
- Releases the lock, if any.
Properties
$cookieDomain
Cookie domain
protected
string
$cookieDomain
= ''
$cookieName
Cookie name to use
protected
string
$cookieName
$cookiePath
Cookie path
protected
string
$cookiePath
= '/'
$cookiePrefix
Cookie prefix
protected
string
$cookiePrefix
= ''
The Config\Cookie::$prefix setting is completely ignored. See https://codeigniter.com/user_guide/libraries/sessions.html#session-preferences
$cookieSecure
Cookie secure?
protected
bool
$cookieSecure
= false
$fingerprint
The Data fingerprint.
protected
string
$fingerprint
$ipAddress
User's IP address.
protected
string
$ipAddress
$lock
Lock placeholder.
protected
bool|string
$lock
= false
$matchIP
Match IP addresses for cookies?
protected
bool
$matchIP
= false
$savePath
The 'save path' for the session varies between
protected
array<string|int, mixed>|string
$savePath
$sessionID
Current session ID
protected
string|null
$sessionID
Methods
__construct()
public
__construct(Session $config, string $ipAddress) : mixed
Parameters
- $config : Session
- $ipAddress : string
destroyCookie()
Internal method to force removal of a cookie by the client when session_destroy() is called.
protected
destroyCookie() : bool
Return values
boolfail()
Drivers other than the 'files' one don't (need to) use the session.save_path INI setting, but that leads to confusing error messages emitted by PHP when open() or write() fail, as the message contains session.save_path ... To work around the problem, the drivers will call this method so that the INI is set just in time for the error message to be properly generated.
protected
fail() : bool
Return values
boollockSession()
A dummy method allowing drivers with no locking functionality (databases other than PostgreSQL and MySQL) to act as if they do acquire a lock.
protected
lockSession(string $sessionID) : bool
Parameters
- $sessionID : string
Return values
boolreleaseLock()
Releases the lock, if any.
protected
releaseLock() : bool