Class Session (namespace Nette\Web)
Provides access to session namespaces as well as session settings and management methods.
Object | --Session
Public Method Summary | |
---|---|
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?
|
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
(string|int|DateTime $time)
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 24 Default file lifetime is 3 hours |
Variable Summary | ||||
---|---|---|---|---|
mixed | $verificationKeyGenerator |
|
line 27 |
Method Details | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
line 334 cleanpublic void clean () Cleans and minimizes meta structures.
|
|||||||||||||||||||||
line 164 closepublic void close () Ends the current session and store session data.
|
|||||||||||||||||||||
line 179 destroypublic void destroy () Destroys all data registered to a session.
|
|||||||||||||||||||||
line 200 existspublic bool exists () Does session exists for the current request?
|
|||||||||||||||||||||
line 496 getCookieParamspublic array getCookieParams () Returns the session cookie parameters.
|
|||||||||||||||||||||
line 536 getHttpRequestprotected IHttpRequest getHttpRequest ()
|
|||||||||||||||||||||
line 546 getHttpResponseprotected IHttpResponse getHttpResponse ()
|
|||||||||||||||||||||
line 231 getIdpublic string getId () Returns the current session ID. Don't make dependencies, can be changed for each request.
|
|||||||||||||||||||||
line 314 getIteratorpublic ArrayIterator getIterator () Iteration over all namespaces.
|
|||||||||||||||||||||
line 261 getNamepublic string getName () Gets the session name.
|
|||||||||||||||||||||
line 279 getNamespacepublic SessionNamespace getNamespace (string $namespace, [string $class = Returns specified session namespace.
|
|||||||||||||||||||||
line 390 getOptionspublic array getOptions () Returns all session options.
|
|||||||||||||||||||||
line 299 hasNamespacepublic bool hasNamespace (string $namespace) Checks if a session namespace exist and is not empty.
|
|||||||||||||||||||||
line 153 isStartedpublic bool isStarted () Has been session started?
|
|||||||||||||||||||||
line 212 regenerateIdpublic void regenerateId () Regenerates the session ID.
|
|||||||||||||||||||||
line 481 setCookieParamspublic Session setCookieParams (string $path, [string $domain = Sets the session cookie parameters.
|
|||||||||||||||||||||
line 455 setExpirationpublic Session setExpiration (string|int|DateTime $time) Sets the amount of time allowed between requests before the session will be terminated.
|
|||||||||||||||||||||
line 243 setNamepublic Session setName (string $name) Sets the session name to a specified one.
|
|||||||||||||||||||||
line 375 setOptionspublic Session setOptions ($options) Sets session options.
|
|||||||||||||||||||||
line 507 setSavePathpublic Session setSavePath ($path) Sets path of the directory used to save session data.
|
|||||||||||||||||||||
line 65 startpublic void start () Starts and initializes session data.
|