Packages

  • Nette
    • Application
      • Diagnostics
      • Responses
      • Routers
      • UI
    • Caching
      • Storages
    • ComponentModel
    • Config
      • Adapters
      • Extensions
    • Database
      • Diagnostics
      • Drivers
      • Reflection
      • Table
    • DI
      • Diagnostics
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
      • Macros
    • Loaders
    • Localization
    • Mail
    • Reflection
    • Security
      • Diagnostics
    • Templating
    • Utils
      • PhpGenerator
  • NetteModule
  • none

Classes

Interfaces

  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Other releases
  • Nette homepage

Class Session

Provides access to session sections as well as session settings and management methods.

Object
Extended by Session
Package: Nette\Http
Author: David Grudl
Located at Http/Session.php
Methods summary
public
# __construct( IHttpRequest $request, IHttpResponse $response )
public
# start( )

Starts and initializes session data.

Starts and initializes session data.

Throws

InvalidStateException
public boolean
# isStarted( )

Has been session started?

Has been session started?

Returns

boolean
public
# close( )

Ends the current session and store session data.

Ends the current session and store session data.

public
# destroy( )

Destroys all data registered to a session.

Destroys all data registered to a session.

public boolean
# exists( )

Does session exists for the current request?

Does session exists for the current request?

Returns

boolean
public
# regenerateId( )

Regenerates the session ID.

Regenerates the session ID.

Throws

InvalidStateException
public string
# getId( )

Returns the current session ID. Don't make dependencies, can be changed for each request.

Returns the current session ID. Don't make dependencies, can be changed for each request.

Returns

string
public Session
# setName( string $name )

Sets the session name to a specified one.

Sets the session name to a specified one.

Parameters

$name
string

Returns

Session
public string
# getName( )

Gets the session name.

Gets the session name.

Returns

string
public SessionSection
# getSection( string $section, string $class = 'SessionSection' )

Returns specified session section.

Returns specified session section.

Parameters

$section
string
$class
string

Returns

SessionSection

Throws

InvalidArgumentException
public
# getNamespace( $section )

Deprecated

public boolean
# hasSection( string $section )

Checks if a session section exist and is not empty.

Checks if a session section exist and is not empty.

Parameters

$section
string

Returns

boolean
public ArrayIterator
# getIterator( )

Iteration over all sections.

Iteration over all sections.

Returns

ArrayIterator
public Session
# setOptions( array $options )

Sets session options.

Sets session options.

Parameters

$options
array

Returns

Session

Throws

NotSupportedException
InvalidStateException
public array
# getOptions( )

Returns all session options.

Returns all session options.

Returns

array
public Session
# setExpiration( string|integer|DateTime $time )

Sets the amount of time allowed between requests before the session will be terminated.

Sets the amount of time allowed between requests before the session will be terminated.

Parameters

$time
string|integer|DateTime
time, value 0 means "until the browser is closed"

Returns

Session
public Session
# setCookieParameters( string $path, string $domain = NULL, boolean $secure = NULL )

Sets the session cookie parameters.

Sets the session cookie parameters.

Parameters

$path
string
path
$domain
string
domain
$secure
boolean
secure

Returns

Session
public array
# getCookieParameters( )

Returns the session cookie parameters.

Returns the session cookie parameters.

Returns

array
containing items: lifetime, path, domain, secure, httponly
public
# setCookieParams( $path, $domain = NULL, $secure = NULL )

Deprecated

public Session
# setSavePath( $path )

Sets path of the directory used to save session data.

Sets path of the directory used to save session data.

Returns

Session
public Session
# setStorage( ISessionStorage $storage )

Sets user session storage.

Sets user session storage.

Returns

Session
Methods inherited from Object
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Constants summary
integer DEFAULT_FILE_LIFETIME 10800
#

Default file lifetime is 3 hours

Default file lifetime is 3 hours

Magic properties summary
public string $name
#
public array $options
#
public read-only boolean $started
#
public read-only string $id
#
public read-only ArrayIterator $iterator
#
public write-only $savePath
#
public write-only ISessionStorage $storage
#
Magic properties inherited from Object
$reflection
Nette Framework 2.0.18 (for PHP 5.2, un-prefixed) API documentation generated by ApiGen 2.8.0