Session
class Session extends Object
Provides access to session sections as well as session settings and management methods.
Constants
DEFAULT_FILE_LIFETIME |
Default file lifetime is 3 hours |
Methods
Starts and initializes session data.
Has been session started?
Ends the current session and store session data.
Destroys all data registered to a session.
Does session exists for the current request?
Regenerates the session ID.
Returns the current session ID. Don't make dependencies, can be changed for each request.
Gets the session name.
Returns specified session section.
Checks if a session section exist and is not empty.
Iteration over all sections.
Cleans and minimizes meta structures. This method is called automatically on shutdown, do not call it directly.
Sets session options.
Returns all session options.
Sets the amount of time allowed between requests before the session will be terminated.
Sets the session cookie parameters.
Returns the session cookie parameters.
Sets path of the directory used to save session data.
Sets user session storage for PHP < 5.4. For PHP >= 5.4, use setHandler().
Details
at line 74
void
start()
Starts and initializes session data.
at line 161
bool
isStarted()
Has been session started?
at line 171
void
close()
Ends the current session and store session data.
at line 185
void
destroy()
Destroys all data registered to a session.
at line 205
bool
exists()
Does session exists for the current request?
at line 216
void
regenerateId()
Regenerates the session ID.
at line 239
string
getId()
Returns the current session ID. Don't make dependencies, can be changed for each request.
at line 250
Session
setName($name)
Sets the session name to a specified one.
at line 267
string
getName()
Gets the session name.
at line 283
SessionSection
getSection($section, $class = 'Nette\\Http\\SessionSection')
Returns specified session section.
at line 294
bool
hasSection($section)
Checks if a session section exist and is not empty.
at line 308
ArrayIterator
getIterator()
Iteration over all sections.
at line 328
void
clean()
internal |
Cleans and minimizes meta structures. This method is called automatically on shutdown, do not call it directly.
at line 363
Session
setOptions(array $options)
Sets session options.
at line 380
array
getOptions()
Returns all session options.
at line 448
Session
setExpiration($time)
Sets the amount of time allowed between requests before the session will be terminated.
at line 473
Session
setCookieParameters($path, $domain = NULL, $secure = NULL)
Sets the session cookie parameters.
at line 487
array
getCookieParameters()
Returns the session cookie parameters.
at line 497
Session
setSavePath($path)
Sets path of the directory used to save session data.
at line 509
Session
setStorage(ISessionStorage $storage)
Sets user session storage for PHP < 5.4. For PHP >= 5.4, use setHandler().
at line 526
Session
setHandler(SessionHandlerInterface $handler)
Sets user session handler.