Documentation

Session extends AbstractSession
in package

Session class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2023 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
3.3.0

Table of Contents

$instance  : object
Instance of the session
$sessionId  : string
Session ID
$sessionName  : string
Session Name
__get()  : mixed
Get method to return the value of the $_SESSION global variable
__isset()  : bool
Return the isset value of the $_SESSION global variable
__set()  : void
Set a property in the session object that is linked to the $_SESSION global variable
__unset()  : void
Unset the $_SESSION global variable
count()  : int
Method to get the count of data in the session
getId()  : string
Return the current the session id
getInstance()  : Session
Determine whether or not an instance of the session object exists already, and instantiate the object if it does not exist.
getIterator()  : ArrayIterator
Method to iterate over the session
getName()  : string
Return the current the session name
kill()  : void
Destroy the session
offsetExists()  : bool
ArrayAccess offsetExists
offsetGet()  : mixed
ArrayAccess offsetGet
offsetSet()  : void
ArrayAccess offsetSet
offsetUnset()  : void
ArrayAccess offsetUnset
regenerateId()  : void
Regenerate the session id
setRequestValue()  : Session
Set a request-based value
setTimedValue()  : Session
Set a time-based value
toArray()  : array<string|int, mixed>
Get the session values as an array
__construct()  : mixed
Constructor
checkExpirations()  : void
Check the time-based session values
checkRequests()  : void
Check the request-based session values
init()  : void
Init the session

Properties

$instance

Instance of the session

private static object $instance = null

$sessionId

Session ID

private string $sessionId = null

$sessionName

Session Name

private string $sessionName = null

Methods

__get()

Get method to return the value of the $_SESSION global variable

public __get(string $name) : mixed
Parameters
$name : string
Return values
mixed

__isset()

Return the isset value of the $_SESSION global variable

public __isset(string $name) : bool
Parameters
$name : string
Return values
bool

__set()

Set a property in the session object that is linked to the $_SESSION global variable

public __set(string $name, mixed $value) : void
Parameters
$name : string
$value : mixed
Tags
throws
Exception
Return values
void

__unset()

Unset the $_SESSION global variable

public __unset(string $name) : void
Parameters
$name : string
Tags
throws
Exception
Return values
void

count()

Method to get the count of data in the session

public count() : int
Return values
int

getId()

Return the current the session id

public getId() : string
Return values
string

getInstance()

Determine whether or not an instance of the session object exists already, and instantiate the object if it does not exist.

public static getInstance([array<string|int, mixed> $options = [] ]) : Session
Parameters
$options : array<string|int, mixed> = []
Return values
Session

getIterator()

Method to iterate over the session

public getIterator() : ArrayIterator
Return values
ArrayIterator

getName()

Return the current the session name

public getName() : string
Return values
string

kill()

Destroy the session

public kill() : void
Return values
void

offsetExists()

ArrayAccess offsetExists

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

ArrayAccess offsetGet

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed
Return values
mixed

offsetSet()

ArrayAccess offsetSet

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed
Tags
throws
Exception
Return values
void

offsetUnset()

ArrayAccess offsetUnset

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed
Return values
void

regenerateId()

Regenerate the session id

public regenerateId([bool $deleteOldSession = true ]) : void
Parameters
$deleteOldSession : bool = true
Return values
void

setRequestValue()

Set a request-based value

public setRequestValue(string $key, mixed $value[, int $hops = 1 ]) : Session
Parameters
$key : string
$value : mixed
$hops : int = 1
Return values
Session

setTimedValue()

Set a time-based value

public setTimedValue(string $key, mixed $value[, int $expire = 300 ]) : Session
Parameters
$key : string
$value : mixed
$expire : int = 300
Return values
Session

toArray()

Get the session values as an array

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

__construct()

Constructor

private __construct([array<string|int, mixed> $options = [] ]) : mixed
Parameters
$options : array<string|int, mixed> = []

Private method to instantiate the session object

Return values
mixed

checkExpirations()

Check the time-based session values

private checkExpirations() : void
Return values
void

checkRequests()

Check the request-based session values

private checkRequests() : void
Return values
void

init()

Init the session

private init() : void
Return values
void

Search results