Namespaces

  • Nette
    • Application
    • Caching
    • Collections
    • Config
    • Forms
    • IO
    • Loaders
    • Mail
    • Reflection
    • Security
    • Templates
    • Web
  • None
  • PHP

Classes

  • Ftp
  • Html
  • HttpContext
  • HttpRequest
  • HttpResponse
  • HttpUploadedFile
  • Session
  • SessionNamespace
  • Uri
  • UriScript
  • User

Interfaces

  • IHttpRequest
  • IHttpResponse
  • IUser

Exceptions

  • FtpException
  • Overview
  • Namespace
  • Class
  • Tree
  • Other releases

Class Session

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

Nette\Object
Extended by Nette\Web\Session
Namespace: Nette\Web
Author: David Grudl
Located at Web/Session.php
Methods summary
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 Nette\Web\Session
# setName( string $name )

Sets the session name to a specified one.

Sets the session name to a specified one.

Parameters

$name
string

Returns

Nette\Web\Session
provides a fluent interface
public string
# getName( )

Gets the session name.

Gets the session name.

Returns

string
public Nette\Web\SessionNamespace
# getNamespace( string $namespace, string $class = 'Nette\Web\SessionNamespace' )

Returns specified session namespace.

Returns specified session namespace.

Parameters

$namespace
string
$class
string

Returns

Nette\Web\SessionNamespace

Throws

InvalidArgumentException
public boolean
# hasNamespace( string $namespace )

Checks if a session namespace exist and is not empty.

Checks if a session namespace exist and is not empty.

Parameters

$namespace
string

Returns

boolean
public ArrayIterator
# getIterator( )

Iteration over all namespaces.

Iteration over all namespaces.

Returns

ArrayIterator
public
# clean( )

Cleans and minimizes meta structures.

Cleans and minimizes meta structures.

public Nette\Web\Session
# setOptions( array $options )

Sets session options.

Sets session options.

Parameters

$options
array

Returns

Nette\Web\Session
provides a fluent interface

Throws

NotSupportedException
InvalidStateException
public array
# getOptions( )

Returns all session options.

Returns all session options.

Returns

array
public Nette\Web\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

Nette\Web\Session
provides a fluent interface
public Nette\Web\Session
# setCookieParams( 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

Nette\Web\Session
provides a fluent interface
public array
# getCookieParams( )

Returns the session cookie parameters.

Returns the session cookie parameters.

Returns

array
containing items: lifetime, path, domain, secure, httponly
public Nette\Web\Session
# setSavePath( $path )

Sets path of the directory used to save session data.

Sets path of the directory used to save session data.

Returns

Nette\Web\Session
provides a fluent interface
protected Nette\Web\IHttpRequest
# getHttpRequest( )

Returns

Nette\Web\IHttpRequest
protected Nette\Web\IHttpResponse
# getHttpResponse( )

Returns

Nette\Web\IHttpResponse
Methods inherited from Nette\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

Nette Framework 0.9.7 API documentation generated by ApiGen 2.3.0