Class Session (namespace Nette\Web)
Provides access to session namespaces as well as session settings and management methods.
Object | --Session
| Constructor Summary | |
|---|---|
| public |
__construct
()
|
| Method Summary | |
|---|---|
| void |
clean
()
Cleans and minimizes meta structures.
|
| void |
close
()
Ends the current session and store session data.
|
| void |
configure
($config, [bool $throwException =
TRUE])
Configurates session environment.
|
| void |
destroy
()
Destroys all data registered to a session.
|
| bool |
exists
()
Does session exists for the current request?
|
| string |
Generates key as protection against Session Hijacking & Fixation.
|
| array |
Returns the session cookie parameters.
|
| protected IHttpRequest |
|
| protected IHttpResponse |
|
| string |
getId
()
Returns the current session ID. Don't make dependencies, can be changed for each request.
|
| ArrayIterator |
getIterator
()
Iteration over all namespaces.
|
| SessionNamespace |
getNamespace
(string $namespace, [string $class =
'SessionNamespace'])
Returns specified session namespace.
|
| bool |
hasNamespace
(string $namespace)
Checks if a session namespace exist and is not empty.
|
| bool |
isStarted
()
Has been session started?
|
| void |
regenerateId
()
Regenerates the session ID.
|
| void |
Sets the session cookie parameters.
|
| void |
setExpiration
(int $seconds)
Sets the amount of time allowed between requests before the session will be terminated.
|
| void |
setId
(string $id)
Sets the session ID to a specified one.
|
| void |
setSavePath
($path)
Sets path of the directory used to save session data.
|
| void |
start
()
Starts and initializes session data.
|
| Constant Summary | |||
|---|---|---|---|
| int | DEFAULT_LIFETIME |
10800 |
line 39 Default lifetime is 3 hours |
| Variable Summary | ||||
|---|---|---|---|---|
| callback | $verificationKeyGenerator | |
line 42 Validation key generator |
|
| Constructor Details | ||
|---|---|---|
|
line 78 __constructpublic __construct () |
||
| Method Details | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
line 369 cleanpublic void clean () Cleans and minimizes meta structures.
|
||||||||||||||||||||||||
|
line 185 closepublic void close () Ends the current session and store session data.
|
||||||||||||||||||||||||
|
line 414 configurepublic void configure ($config, [bool $throwException = Configurates session environment.
|
||||||||||||||||||||||||
|
line 199 destroypublic void destroy () Destroys all data registered to a session.
|
||||||||||||||||||||||||
|
line 220 existspublic bool exists () Does session exists for the current request?
|
||||||||||||||||||||||||
|
line 286 generateVerificationKeypublic string generateVerificationKey () Generates key as protection against Session Hijacking & Fixation.
|
||||||||||||||||||||||||
|
line 509 getCookieParamspublic array getCookieParams () Returns the session cookie parameters.
|
||||||||||||||||||||||||
|
line 536 getHttpRequestprotected IHttpRequest getHttpRequest ()
|
||||||||||||||||||||||||
|
line 546 getHttpResponseprotected IHttpResponse getHttpResponse ()
|
||||||||||||||||||||||||
|
line 275 getIdpublic string getId () Returns the current session ID. Don't make dependencies, can be changed for each request.
|
||||||||||||||||||||||||
|
line 349 getIteratorpublic ArrayIterator getIterator () Iteration over all namespaces.
|
||||||||||||||||||||||||
|
line 310 getNamespacepublic SessionNamespace getNamespace (string $namespace, [string $class = Returns specified session namespace.
|
||||||||||||||||||||||||
|
line 334 hasNamespacepublic bool hasNamespace (string $namespace) Checks if a session namespace exist and is not empty.
|
||||||||||||||||||||||||
|
line 174 isStartedpublic bool isStarted () Has been session started?
|
||||||||||||||||||||||||
|
line 232 regenerateIdpublic void regenerateId () Regenerates the session ID.
|
||||||||||||||||||||||||
|
line 494 setCookieParamspublic void setCookieParams (string $path, [string $domain = Sets the session cookie parameters.
|
||||||||||||||||||||||||
|
line 466 setExpirationpublic void setExpiration (int $seconds) Sets the amount of time allowed between requests before the session will be terminated.
|
||||||||||||||||||||||||
|
line 256 setIdpublic void setId (string $id) Sets the session ID to a specified one.
|
||||||||||||||||||||||||
|
line 520 setSavePathpublic void setSavePath ($path) Sets path of the directory used to save session data.
|
||||||||||||||||||||||||
|
line 90 startpublic void start () Starts and initializes session data.
|
||||||||||||||||||||||||