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 |
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.
|
array |
getOptions
()
Returns all session options.
|
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.
|
Session |
Sets the session cookie parameters.
|
Session |
setExpiration
(mixed $seconds)
Sets the amount of time allowed between requests before the session will be terminated.
|
Session |
setName
(string $name)
Sets the session name to a specified one.
|
Session |
setOptions
($options)
Sets session options.
|
Session |
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 36 Default file lifetime is 3 hours |
Variable Summary | ||||
---|---|---|---|---|
callback | $verificationKeyGenerator |
|
line 39 Validation key generator |
Method Details | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
line 72 __constructpublic Session __construct ()
|
|||||||||||||||||||||
line 393 cleanpublic void clean () Cleans and minimizes meta structures.
|
|||||||||||||||||||||
line 205 closepublic void close () Ends the current session and store session data.
|
|||||||||||||||||||||
line 219 destroypublic void destroy () Destroys all data registered to a session.
|
|||||||||||||||||||||
line 240 existspublic bool exists () Does session exists for the current request?
|
|||||||||||||||||||||
line 312 generateVerificationKeypublic string generateVerificationKey () Generates key as protection against Session Hijacking & Fixation.
|
|||||||||||||||||||||
line 564 getCookieParamspublic array getCookieParams () Returns the session cookie parameters.
|
|||||||||||||||||||||
line 604 getHttpRequestprotected IHttpRequest getHttpRequest ()
|
|||||||||||||||||||||
line 614 getHttpResponseprotected IHttpResponse getHttpResponse ()
|
|||||||||||||||||||||
line 271 getIdpublic string getId () Returns the current session ID. Don't make dependencies, can be changed for each request.
|
|||||||||||||||||||||
line 373 getIteratorpublic ArrayIterator getIterator () Iteration over all namespaces.
|
|||||||||||||||||||||
line 301 getNamepublic string getName () Gets the session name.
|
|||||||||||||||||||||
line 338 getNamespacepublic SessionNamespace getNamespace (string $namespace, [string $class = Returns specified session namespace.
|
|||||||||||||||||||||
line 452 getOptionspublic array getOptions () Returns all session options.
|
|||||||||||||||||||||
line 358 hasNamespacepublic bool hasNamespace (string $namespace) Checks if a session namespace exist and is not empty.
|
|||||||||||||||||||||
line 194 isStartedpublic bool isStarted () Has been session started?
|
|||||||||||||||||||||
line 252 regenerateIdpublic void regenerateId () Regenerates the session ID.
|
|||||||||||||||||||||
line 549 setCookieParamspublic Session setCookieParams (string $path, [string $domain = Sets the session cookie parameters.
|
|||||||||||||||||||||
line 517 setExpirationpublic Session setExpiration (mixed $seconds) Sets the amount of time allowed between requests before the session will be terminated.
|
|||||||||||||||||||||
line 283 setNamepublic Session setName (string $name) Sets the session name to a specified one.
|
|||||||||||||||||||||
line 437 setOptionspublic Session setOptions ($options) Sets session options.
|
|||||||||||||||||||||
line 575 setSavePathpublic Session setSavePath ($path) Sets path of the directory used to save session data.
|
|||||||||||||||||||||
line 84 startpublic void start () Starts and initializes session data.
|