- Timestamp:
- 09/09/04 15:14:59 (4 years ago)
- Files:
-
- trunk/autopackage.php (modified) (2 diffs)
- trunk/docs/readme.txt (modified) (2 diffs)
- trunk/examples/example_secure_fix.php (modified) (2 diffs)
- trunk/examples/example_secure_fixbrowser.php (added)
- trunk/examples/example_secure_fixip.php (added)
- trunk/examples/example_secure_fixreferer.php (added)
- trunk/examples/index_sections.php (modified) (1 diff)
- trunk/patSession.php (modified) (1 diff)
- trunk/patSession/Storage.php (modified) (5 diffs)
- trunk/patSession/Storage/Native.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/autopackage.php
r16 r17 10 10 * 11 11 * @author Stephan Schmidt <schst@php-tools.net> 12 * @author gERD Schaufelberger <gerd@php-tools.net> 12 13 * @package patSession 13 14 * @subpackage Tools 14 15 */ 15 16 16 $baseVersion = '1.0. 1';17 $baseVersion = '1.0.2'; 17 18 18 19 /** … … 36 37 */ 37 38 $notes = <<<EOT 38 Still in development, no public release yet. 39 first public release 39 40 EOT; 40 41 trunk/docs/readme.txt
r16 r17 1 1 /** 2 * patSe asson2 * patSession 3 3 * 4 4 * $Id$ … … 13 13 */ 14 14 15 Download at http://www.php-tools.net 15 Download at http://snaps.php-tools.net 16 Homepage at http://www.php-tools.net 16 17 17 18 This program and all associated files are released under the GNU Lesser Public License, trunk/examples/example_secure_fix.php
r10 r17 26 26 'security' => 'fix_browser,fix_ip,fix_referer', 27 27 'allow-referer' => '*.php-tools.net,*.php-tools.de', 28 'empty-referer' => ' deny'28 'empty-referer' => 'allow' 29 29 ); 30 30 … … 52 52 The session is bounded to the client's ip address. <br> <br> 53 53 <b>fix_referer</b>: <br> 54 All session values will be cleared if the referer is empty or a a foreign host.<br>54 All session values will be cleared if the referer is empty or an unknown host.<br> 55 55 The fix-referer-feature can be combined two other options: 'empty-referer' (deny, allow) 56 56 and 'allow-referer'. trunk/examples/index_sections.php
r11 r17 61 61 'descr' => 'Expire idle sessions' 62 62 ), 63 'fix' => array( 64 'title' => 'Fixiation', 65 'descr' => 'Fixiation features of patSession helps you to avoid session-hijacking.', 63 'fixbrowser' => array( 64 'title' => 'Fix browser', 65 'descr' => 'patSession allows to fix a session to a browser. Therefore all session data will be destroyed if the users tries to continue the session wit a different browser', 66 ), 67 'fixip' => array( 68 'title' => 'Fix IP address', 69 'descr' => 'This feature avoids to continue any session from a different IP address then it was started.', 70 ), 71 'fixreferer' => array( 72 'title' => 'Fix referer', 73 'descr' => 'Fixiation of the referer forces to stay on the same referer.', 66 74 ), 67 75 'fork' => array( trunk/patSession.php
r12 r17 5 5 * $Id$ 6 6 * 7 * @version 1.0. 07 * @version 1.0.2 8 8 * @package patSession 9 9 * trunk/patSession/Storage.php
r16 r17 5 5 * $Id$ 6 6 * 7 * @version 1.0. 07 * @version 1.0.2 8 8 * @package patSession 9 9 * … … 54 54 * @var string $_emptyReferer 'deny' is default 55 55 */ 56 var $_emptyReferer = null;56 var $_emptyReferer = 'allow'; 57 57 58 58 /** … … 160 160 /** 161 161 * create a new session and copy variables from the old one 162 * 163 * Actually cloning sessions is neccessary to implement some 164 * security features. Usually the application wants to clone 165 * the session during a user-login process. 162 166 * 163 167 * @abstract … … 217 221 if( $this->_emptyReferer !== 'allow' ) 218 222 { 219 $this->_state = 'empty_referer';220 return false;223 $this->_state = 'empty_referer'; 224 return false; 221 225 } 222 226 } … … 352 356 353 357 // allow empty referer 354 if( isset( $options['empty-referer'] ) && $options['empty-referer'] === 'allow' )355 { 356 $this->_emptyReferer = ' allow';358 if( isset( $options['empty-referer'] ) && $options['empty-referer'] !== 'allow' ) 359 { 360 $this->_emptyReferer = 'deny'; 357 361 } 358 362 trunk/patSession/Storage/Native.php
r16 r17 8 8 * $Id$ 9 9 * 10 * @version 1.0. 010 * @version 1.0.2 11 11 * @package patSession 12 12 * … … 102 102 if( $this->_state === 'destroyed' ) 103 103 { 104 patErrorManager::raiseNotice( 'patSession _' . PATSESSION_ERROR_NOT_ACTIVE,104 patErrorManager::raiseNotice( 'patSession:' . PATSESSION_ERROR_NOT_ACTIVE, 105 105 'Session is not active - nothing to clear', 106 106 'The session was destroyed before.' … … 124 124 if( $this->_state !== 'active' ) 125 125 { 126 return patErrorManager::raiseError( 'patSession _' . PATSESSION_ERROR_NOT_ACTIVE,126 return patErrorManager::raiseError( 'patSession:' . PATSESSION_ERROR_NOT_ACTIVE, 127 127 'Cannot set value because session not active.', 128 128 'Either the session was destroyed, has expired or locked by security' … … 145 145 if( $this->_state !== 'active' ) 146 146 { 147 return patErrorManager::raiseWarning( 'patSession _' . PATSESSION_ERROR_NOT_ACTIVE,147 return patErrorManager::raiseWarning( 'patSession:' . PATSESSION_ERROR_NOT_ACTIVE, 148 148 'Cannot recieve value because session not active.', 149 149 'Either the session was destroyed, has expired or locked because of security reasons.' … … 170 170 if( $this->_state !== 'active' ) 171 171 { 172 patErrorManager::raiseNotice( 'patSession _' . PATSESSION_ERROR_NOT_ACTIVE,172 patErrorManager::raiseNotice( 'patSession:' . PATSESSION_ERROR_NOT_ACTIVE, 173 173 'Session is not active - nothing to clear', 174 174 'Either the session was destroyed, has expired or locked because of security reasons.' … … 197 197 if( $this->_state === 'destroyed' ) 198 198 { 199 patErrorManager::raiseNotice( 'patSession _' . PATSESSION_ERROR_NOT_ACTIVE,199 patErrorManager::raiseNotice( 'patSession:' . PATSESSION_ERROR_NOT_ACTIVE, 200 200 'Session is not active.', 201 201 'The session was destroyed before.' … … 225 225 if( !$this->_checkSecurity( true ) ) 226 226 { 227 return patErrorManager::raiseNotice( 'patSession _' . PATSESSION_ERROR_NOT_ACTIVE,227 return patErrorManager::raiseNotice( 'patSession:' . PATSESSION_ERROR_NOT_ACTIVE, 228 228 'Session is not active.', 229 229 'Either the session was destroyed, has expired or locked because of security reasons: '. $this->_state.'.'
