PHP Класс Nette\Http\Session

Наследование: use trait Nette\SmartObject
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( Nette\Http\IRequest $request, Nette\Http\IResponse $response )
clean ( ) : void Cleans and minimizes meta structures. This method is called automatically on shutdown, do not call it directly.
close ( ) : void Ends the current session and store session data.
destroy ( ) : void Destroys all data registered to a session.
exists ( ) : boolean Does session exists for the current request?
getCookieParameters ( ) : array Returns the session cookie parameters.
getId ( ) : string Returns the current session ID. Don't make dependencies, can be changed for each request.
getIterator ( ) : ArrayIterator Iteration over all sections.
getName ( ) : string Gets the session name.
getOptions ( ) : array Returns all session options.
getSection ( $section, $class = SessionSection::class ) : SessionSection Returns specified session section.
hasSection ( $section ) : boolean Checks if a session section exist and is not empty.
isStarted ( ) : boolean Has been session started?
regenerateId ( ) : void Regenerates the session ID.
setCookieParameters ( $path, $domain = NULL, $secure = NULL ) : self Sets the session cookie parameters.
setExpiration ( $time ) : self Sets the amount of time allowed between requests before the session will be terminated.
setHandler ( SessionHandlerInterface $handler ) : self Sets user session handler.
setName ( $name ) : self Sets the session name to a specified one.
setOptions ( array $options ) : self Sets session options.
setSavePath ( $path ) : self Sets path of the directory used to save session data.
setStorage ( Nette\Http\ISessionStorage $storage ) : self
start ( ) : void Starts and initializes session data.

Приватные методы

Метод Описание
configure ( array $config ) : void Configures session environment.
sendCookie ( ) : void Sends the session cookies.

Описание методов

__construct() публичный метод

public __construct ( Nette\Http\IRequest $request, Nette\Http\IResponse $response )
$request Nette\Http\IRequest
$response Nette\Http\IResponse

clean() публичный метод

Cleans and minimizes meta structures. This method is called automatically on shutdown, do not call it directly.
public clean ( ) : void
Результат void

close() публичный метод

Ends the current session and store session data.
public close ( ) : void
Результат void

destroy() публичный метод

Destroys all data registered to a session.
public destroy ( ) : void
Результат void

exists() публичный метод

Does session exists for the current request?
public exists ( ) : boolean
Результат boolean

getCookieParameters() публичный метод

Returns the session cookie parameters.
public getCookieParameters ( ) : array
Результат array containing items: lifetime, path, domain, secure, httponly

getId() публичный метод

Returns the current session ID. Don't make dependencies, can be changed for each request.
public getId ( ) : string
Результат string

getIterator() публичный метод

Iteration over all sections.
public getIterator ( ) : ArrayIterator
Результат ArrayIterator

getName() публичный метод

Gets the session name.
public getName ( ) : string
Результат string

getOptions() публичный метод

Returns all session options.
public getOptions ( ) : array
Результат array

getSection() публичный метод

Returns specified session section.
public getSection ( $section, $class = SessionSection::class ) : SessionSection
Результат SessionSection

hasSection() публичный метод

Checks if a session section exist and is not empty.
public hasSection ( $section ) : boolean
Результат boolean

isStarted() публичный метод

Has been session started?
public isStarted ( ) : boolean
Результат boolean

regenerateId() публичный метод

Regenerates the session ID.
public regenerateId ( ) : void
Результат void

setCookieParameters() публичный метод

Sets the session cookie parameters.
public setCookieParameters ( $path, $domain = NULL, $secure = NULL ) : self
Результат self

setExpiration() публичный метод

Sets the amount of time allowed between requests before the session will be terminated.
public setExpiration ( $time ) : self
Результат self

setHandler() публичный метод

Sets user session handler.
public setHandler ( SessionHandlerInterface $handler ) : self
$handler SessionHandlerInterface
Результат self

setName() публичный метод

Sets the session name to a specified one.
public setName ( $name ) : self
Результат self

setOptions() публичный метод

Sets session options.
public setOptions ( array $options ) : self
$options array
Результат self

setSavePath() публичный метод

Sets path of the directory used to save session data.
public setSavePath ( $path ) : self
Результат self

setStorage() публичный метод

Устаревший: use setHandler().
public setStorage ( Nette\Http\ISessionStorage $storage ) : self
$storage Nette\Http\ISessionStorage
Результат self

start() публичный метод

Starts and initializes session data.
public start ( ) : void
Результат void