Development

/branches/1.3/lib/storage/sfNoStorage.class.php

You must first sign up to be able to contribute.

root/branches/1.3/lib/storage/sfNoStorage.class.php

Revision 9942, 2.3 kB (checked in by fabien, 6 years ago)

added sfSession::regenerate and added calls on authentication/credential change to protect against session fixation attacks (closes #5325 - patch from Dustin)

  • Property svn:mime-type set to text/x-php
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1 <?php
2
3 /*
4  * This file is part of the symfony package.
5  * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10
11 /**
12  * sfNoStorage allows you to disable session support.
13  *
14  * To disable sessions, change the storage factory in config/factories.yml:
15  *
16  *   storage:
17  *    class: sfNoStorage
18  *
19  * @package    symfony
20  * @subpackage storage
21  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
22  * @version    SVN: $Id$
23  */
24 class sfNoStorage extends sfStorage
25 {
26   /**
27    * Reads data from this storage.
28    *
29    * The preferred format for a key is directory style so naming conflicts can be avoided.
30    *
31    * @param  string $key  A unique key identifying your data
32    *
33    * @return mixed Data associated with the key
34    *
35    * @throws <b>sfStorageException</b> If an error occurs while reading data from this storage
36    */
37   public function read($key)
38   {
39     return null;
40   }
41
42   /**
43    * Removes data from this storage.
44    *
45    * The preferred format for a key is directory style so naming conflicts can be avoided.
46    *
47    * @param  string $key  A unique key identifying your data
48    *
49    * @return mixed Data associated with the key
50    *
51    * @throws <b>sfStorageException</b> If an error occurs while removing data from this storage
52    */
53   public function remove($key)
54   {
55     return null;
56   }
57
58   /**
59    * Writes data to this storage.
60    *
61    * The preferred format for a key is directory style so naming conflicts can be avoided.
62    *
63    * @param  string $key   A unique key identifying your data
64    * @param  mixed  $data  Data associated with your key
65    *
66    * @throws <b>sfStorageException</b> If an error occurs while writing to this storage
67    */
68   public function write($key, $data)
69   {
70   }
71
72   /**
73    * Regenerates id that represents this storage.
74    *
75    * @param  boolean $destroy Destroy session when regenerating?
76    *
77    * @return boolean True if session regenerated, false if error
78    *
79    */
80   public function regenerate($destroy = false)
81   {
82     return true;
83   }
84
85   /**
86    * Executes the shutdown procedure.
87    *
88    * @throws <b>sfStorageException</b> If an error occurs while shutting down this storage
89    */
90   public function shutdown()
91   {
92   }
93 }
94
Note: See TracBrowser for help on using the browser.