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 {@link setCacheModuleID CacheModuleID} property which should refer to a valid cache module configured in the application configuration. The following example shows how we configure TCacheHttpSession: 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.
Since: 3.1.1
Author: Carl G. Mathisen (carlgmathisen@gmail.com)
Author: Qiang Xue (qiang.xue@gmail.com)
Inheritance: extends THttpSession
 public function testInit()
 {
     $session = new TCacheHttpSession();
     try {
         $session->init(null);
         $this->fail("Expected TConfigurationException is not raised");
     } catch (TConfigurationException $e) {
     }
     unset($session);
     $session = new TCacheHttpSession();
     try {
         $session->setCacheModuleID('MaiCache');
         $session->init(null);
         $this->fail("Expected TConfigurationException is not raised");
         $session->open();
     } catch (TConfigurationException $e) {
     }
     unset($session);
     self::$session = new TCacheHttpSession();
     try {
         self::$session->setCacheModuleID('MyCache');
         self::$session->init(null);
     } catch (TConfigurationException $e) {
         $this->fail('TConfigurationException is not expected');
         self::markTestSkipped('Cannot continue this test');
     }
 }