Class TCacheHttpSession
TCacheHttpSession class
TCacheHttpSession provides access for storing session data using a cache module (e.g. TMemCache, TDbCache). To specify the cache module for data storage, set the setCacheModuleID CacheModuleID property which should refer to a valid cache module configured in the application configuration.
The following example shows how we configure TCacheHttpSession:
<modules> <module id="cache" class="System.Caching.TMemCache" Host="localhost" Port="11211" /> <module id="session" class="System.Web.TCacheHttpSession" CacheModuleID="cache" SessionName="SSID" CookieMode="Allow" AutoStart="true" GCProbability="1" UseTransparentSessionID="true" TimeOut="3600" /> </modules>
Beware, by definition cache storage are volatile, which means the data stored on them may be swapped out and get lost. This may not be the case for certain cache storage, such as database. So make sure you manage your cache properly to avoid loss of session data.
- TComponent
-
TApplicationComponent
-
THttpSession implements IteratorAggregate, ArrayAccess, Countable, IModule
-
TCacheHttpSession
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Carl G. Mathisen <carlgmathisen@gmail.com>
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 3.1.1
Located at Web/TCacheHttpSession.php
public
|
#
init(
Initializes the module. This method is required by IModule. It reads the CacheModule property. |
public
string
|
|
public
|
|
public
|
|
public
string
|
|
public
boolean
|
|
public
boolean
|
#
_destroy( string $id )
Session destroy handler. This method should be overriden if setUseCustomStorage UseCustomStorage is set true. |
public
string
|
|
public
|
|
protected
string
|
getApplication(),
getRequest(),
getResponse(),
getService(),
getSession(),
getUser(),
publishAsset(),
publishFilePath()
|
GLOBAL_RAISE_EVENT_LISTENER
|