Class Session (namespace Nette\Web)
Provides access to session namespaces as well as session settings and management methods.
Object | --Session
| Public Method Summary | |
|---|---|
| Session |
__construct
()
|
| 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.
|
| string |
getId
()
Returns the current session ID. Don't make dependencies, can be changed for each request.
|
| ArrayIterator |
getIterator
()
Iteration over all namespaces.
|
| string |
getName
()
Gets the session name.
|
| 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
($id)
Sets the session ID to a specified one.
|
| void |
setName
(string $name)
Sets the session name to a specified one.
|
| void |
setSavePath
($path)
Sets path of the directory used to save session data.
|
| void |
start
()
Starts and initializes session data.
|
| Protected Method Summary | |
|---|---|
| protected IHttpRequest |
|
| protected IHttpResponse |
|
| Methods Inherited From Object |
|---|
| extensionMethod(), getClass(), getReflection(), __call(), __callStatic(), __get(), __isset(), __set(), __unset() |
| Constant Summary | |||
|---|---|---|---|
| int | DEFAULT_FILE_LIFETIME |
10800 |
line 37 Default file lifetime is 3 hours |
| Variable Summary | ||||
|---|---|---|---|---|
| callback | $verificationKeyGenerator | |
line 40 Validation key generator |
|
| Method Details | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
line 73 __constructpublic Session __construct ()
|
||||||||||||||||||||||||
|
line 396 cleanpublic void clean () Cleans and minimizes meta structures.
|
||||||||||||||||||||||||
|
line 199 closepublic void close () Ends the current session and store session data.
|
||||||||||||||||||||||||
|
line 441 configurepublic void configure ($config, [bool $throwException = Configurates session environment.
|
||||||||||||||||||||||||
|
line 213 destroypublic void destroy () Destroys all data registered to a session.
|
||||||||||||||||||||||||
|
line 234 existspublic bool exists () Does session exists for the current request?
|
||||||||||||||||||||||||
|
line 317 generateVerificationKeypublic string generateVerificationKey () Generates key as protection against Session Hijacking & Fixation.
|
||||||||||||||||||||||||
|
line 536 getCookieParamspublic array getCookieParams () Returns the session cookie parameters.
|
||||||||||||||||||||||||
|
line 576 getHttpRequestprotected IHttpRequest getHttpRequest ()
|
||||||||||||||||||||||||
|
line 586 getHttpResponseprotected IHttpResponse getHttpResponse ()
|
||||||||||||||||||||||||
|
line 277 getIdpublic string getId () Returns the current session ID. Don't make dependencies, can be changed for each request.
|
||||||||||||||||||||||||
|
line 376 getIteratorpublic ArrayIterator getIterator () Iteration over all namespaces.
|
||||||||||||||||||||||||
|
line 306 getNamepublic string getName () Gets the session name.
|
||||||||||||||||||||||||
|
line 341 getNamespacepublic SessionNamespace getNamespace (string $namespace, [string $class = Returns specified session namespace.
|
||||||||||||||||||||||||
|
line 361 hasNamespacepublic bool hasNamespace (string $namespace) Checks if a session namespace exist and is not empty.
|
||||||||||||||||||||||||
|
line 188 isStartedpublic bool isStarted () Has been session started?
|
||||||||||||||||||||||||
|
line 246 regenerateIdpublic void regenerateId () Regenerates the session ID.
|
||||||||||||||||||||||||
|
line 521 setCookieParamspublic void setCookieParams (string $path, [string $domain = Sets the session cookie parameters.
|
||||||||||||||||||||||||
|
line 493 setExpirationpublic void setExpiration (int $seconds) Sets the amount of time allowed between requests before the session will be terminated.
|
||||||||||||||||||||||||
|
line 266 setIdpublic void setId ($id) Sets the session ID to a specified one.
|
||||||||||||||||||||||||
|
line 289 setNamepublic void setName (string $name) Sets the session name to a specified one.
|
||||||||||||||||||||||||
|
line 547 setSavePathpublic void setSavePath ($path) Sets path of the directory used to save session data.
|
||||||||||||||||||||||||
|
line 85 startpublic void start () Starts and initializes session data.
|
||||||||||||||||||||||||
