\CodeIgniter\Session\HandlersFileHandler

Session handler using file system for storage

Summary

Methods
Properties
Constants
__construct()
setLogger()
open()
read()
write()
close()
destroy()
gc()
No public properties found
No constants found
destroyCookie()
lockSession()
releaseLock()
fail()
configureSessionIDRegex()
$fingerprint
$lock
$cookiePrefix
$cookieDomain
$cookiePath
$cookieSecure
$cookieName
$matchIP
$sessionID
$savePath
$ipAddress
$logger
$fileHandle
$filePath
$fileNew
N/A
No private methods found
No private properties found
N/A

Properties

$fingerprint

$fingerprint : boolean

The Data fingerprint.

Type

boolean

$lock

$lock : mixed

Lock placeholder.

Type

mixed

$cookiePrefix

$cookiePrefix : string

Cookie prefix

Type

string

$cookieDomain

$cookieDomain : string

Cookie domain

Type

string

$cookiePath

$cookiePath : string

Cookie path

Type

string

$cookieSecure

$cookieSecure : boolean

Cookie secure?

Type

boolean

$cookieName

$cookieName : string

Cookie name to use

Type

string

$matchIP

$matchIP : boolean

Whether IP addresses should be matched.

Type

boolean

$sessionID

$sessionID : string

Current session ID

Type

string

$savePath

$savePath : string

Where to save the session files to.

Type

string

$ipAddress

$ipAddress : string

User's IP address.

Type

string

$fileHandle

$fileHandle : resource

The file handle

Type

resource

$filePath

$filePath : resource

File Name

Type

resource

$fileNew

$fileNew : boolean

Whether this is a new file.

Type

boolean

Methods

__construct()

__construct(\CodeIgniter\Config\BaseConfig  $config, string  $ipAddress) 

Constructor

Parameters

\CodeIgniter\Config\BaseConfig $config
string $ipAddress

open()

open(string  $savePath, string  $name) : boolean

Open

Sanitizes the save_path directory.

Parameters

string $savePath

Path to session files' directory

string $name

Session cookie name

Throws

\Exception

Returns

boolean

read()

read(string  $sessionID) : string

Read

Reads session data and acquires a lock

Parameters

string $sessionID

Session ID

Returns

string —

Serialized session data

write()

write(string  $sessionID, string  $sessionData) : boolean

Write

Writes (create / update) session data

Parameters

string $sessionID

Session ID

string $sessionData

Serialized session data

Returns

boolean

close()

close() : boolean

Close

Releases locks and closes file descriptor.

Returns

boolean

destroy()

destroy(string  $session_id) : boolean

Destroy

Destroys the current session.

Parameters

string $session_id

Session ID

Returns

boolean

gc()

gc(integer  $maxlifetime) : boolean

Garbage Collector

Deletes expired sessions

Parameters

integer $maxlifetime

Maximum lifetime of sessions

Returns

boolean

destroyCookie()

destroyCookie() : boolean

Internal method to force removal of a cookie by the client when session_destroy() is called.

Returns

boolean

lockSession()

lockSession(string  $sessionID) : boolean

A dummy method allowing drivers with no locking functionality (databases other than PostgreSQL and MySQL) to act as if they do acquire a lock.

Parameters

string $sessionID

Returns

boolean

releaseLock()

releaseLock() : boolean

Releases the lock, if any.

Returns

boolean

fail()

fail() : boolean

Fail

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.

Returns

boolean

configureSessionIDRegex()

configureSessionIDRegex() 

Configure Session ID regular expression