PHP Class Pimcore\Tool\Session

Show file Open project: pimcore/pimcore Class Usage Examples

Protected Properties

Property Type Description
$openedSessions contains how many sessions are currently open, this is important, because writeClose() must not be called if there is still an open session, this is especially important if something doesn't use the method use() but get() so the session isn't closed automatically after the action is done
$options array
$restoreSession array
$sessionCookieCleanupNeeded boolean when using mod_php, session_start() always adds an Set-Cookie header when called, this is the case in self::get(), so depending on how often self::get() is called the more header will get added to the response, so we clean them up in Pimcore::outputBufferEnd() to avoid problems with (reverse-)proxies such as Varnish who do not like too much Set-Cookie headers
$sessions array contains the session namespace objects

Public Methods

Method Description
get ( string $namespace = "pimcore_admin", boolean $readOnly = false ) : Zend_Session_Namespace
getOption ( $name ) : mixed
getReadOnly ( string $namespace = "pimcore_admin" ) : stdClass
isSessionCookieCleanupNeeded ( ) : boolean
regenerateId ( )
setOption ( $name, $value )
useSession ( $func, string $namespace = "pimcore_admin" ) : mixed
writeClose ( )

Protected Methods

Method Description
backupForeignSession ( ) : boolean
restoreForeignSession ( ) : boolean

Method Details

backupForeignSession() protected static method

protected static backupForeignSession ( ) : boolean
return boolean

get() public static method

public static get ( string $namespace = "pimcore_admin", boolean $readOnly = false ) : Zend_Session_Namespace
$namespace string
$readOnly boolean
return Zend_Session_Namespace

getOption() public static method

public static getOption ( $name ) : mixed
$name
return mixed

getReadOnly() public static method

public static getReadOnly ( string $namespace = "pimcore_admin" ) : stdClass
$namespace string
return stdClass

isSessionCookieCleanupNeeded() public static method

public static isSessionCookieCleanupNeeded ( ) : boolean
return boolean

regenerateId() public static method

public static regenerateId ( )

restoreForeignSession() protected static method

protected static restoreForeignSession ( ) : boolean
return boolean

setOption() public static method

public static setOption ( $name, $value )
$name
$value

useSession() public static method

public static useSession ( $func, string $namespace = "pimcore_admin" ) : mixed
$func
$namespace string
return mixed

writeClose() public static method

public static writeClose ( )

Property Details

$openedSessions protected static property

contains how many sessions are currently open, this is important, because writeClose() must not be called if there is still an open session, this is especially important if something doesn't use the method use() but get() so the session isn't closed automatically after the action is done
protected static $openedSessions

$options protected static property

protected static array $options
return array

$restoreSession protected static property

protected static array $restoreSession
return array

$sessionCookieCleanupNeeded protected static property

when using mod_php, session_start() always adds an Set-Cookie header when called, this is the case in self::get(), so depending on how often self::get() is called the more header will get added to the response, so we clean them up in Pimcore::outputBufferEnd() to avoid problems with (reverse-)proxies such as Varnish who do not like too much Set-Cookie headers
protected static bool $sessionCookieCleanupNeeded
return boolean

$sessions protected static property

contains the session namespace objects
protected static array $sessions
return array