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 72
void
start()
Starts and initializes session data.
at line 159
bool
isStarted()
Has been session started?
at line 169
void
close()
Ends the current session and store session data.
at line 183
void
destroy()
Destroys all data registered to a session.
at line 203
bool
exists()
Does session exists for the current request?
at line 214
void
regenerateId()
Regenerates the session ID.
at line 237
string
getId()
Returns the current session ID. Don't make dependencies, can be changed for each request.
at line 248
Session
setName($name)
Sets the session name to a specified one.
at line 265
string
getName()
Gets the session name.
at line 281
SessionSection
getSection($section, $class = 'Nette\\Http\\SessionSection')
Returns specified session section.
at line 292
bool
hasSection($section)
Checks if a session section exist and is not empty.
at line 306
ArrayIterator
getIterator()
Iteration over all sections.
at line 326
void
clean()
internal |
Cleans and minimizes meta structures. This method is called automatically on shutdown, do not call it directly.
at line 361
Session
setOptions(array $options)
Sets session options.
at line 386
array
getOptions()
Returns all session options.
at line 449
Session
setExpiration($time)
Sets the amount of time allowed between requests before the session will be terminated.
at line 474
Session
setCookieParameters($path, $domain = NULL, $secure = NULL)
Sets the session cookie parameters.
at line 488
array
getCookieParameters()
Returns the session cookie parameters.
at line 498
Session
setSavePath($path)
Sets path of the directory used to save session data.
at line 510
Session
setStorage(ISessionStorage $storage)
Sets user session storage for PHP < 5.4. For PHP >= 5.4, use setHandler().
at line 527
Session
setHandler(SessionHandlerInterface $handler)
Sets user session handler.