- Timestamp:
- 05/10/07 11:56:46 (2 years ago)
- Files:
-
- branches/patSession2/patSession/Storage.php (modified) (6 diffs)
- branches/patSession2/patSession/Storage/Cli.php (modified) (1 diff)
- branches/patSession2/patSession/Storage/Native.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/patSession2/patSession/Storage.php
r52 r54 5 5 * $Id$ 6 6 * 7 * @version 2. 1.17 * @version 2.2.0 8 8 * @package patSession 9 9 * @subpackage Storage … … 103 103 104 104 /** 105 * cookie parameter 106 * @access protected 107 * @var string $_cookieParam 108 */ 109 protected $_cookieParam = array( 110 'lifetime' => 0, 111 'path' => '/', 112 'domain' => null, 113 'secure' => false 114 ); 115 116 /** 105 117 * security policy 106 118 * Default values: … … 332 344 */ 333 345 public function set( $name, $value ) 334 { 335 if( $this->_state !== 'active' ) {346 { 347 if( $this->_state !== 'active' ) { 336 348 $error =& patErrorManager::raiseError( 'patSession:' . patSession::ERROR_NOT_ACTIVE, 337 349 'Cannot set value because session not active.', … … 342 354 343 355 $this->_sess[$name] = $value; 356 344 357 return true; 345 358 } … … 750 763 // try to set a cookie 751 764 if( $this->_tokenMode == 'any' || $this->_tokenMode == 'cookie' ) { 752 setcookie( $this->_tokenName, $token ); 765 setcookie( $this->_tokenName 766 , $token 767 , $this->_cookieParam['lifetime'] 768 , $this->_cookieParam['path'] 769 , $this->_cookieParam['domain'] 770 , $this->_cookieParam['secure'] 771 ); 753 772 } 754 773 } … … 790 809 protected function _setOptions( &$options ) 791 810 { 811 // cookie parametzer 812 if( isset( $options['cookie-lifetime'] ) ) { 813 $this->_cookieParam['lifetime'] = $options['cookie-lifetime']; 814 } 815 if( isset( $options['cookie-path'] ) ) { 816 $this->_cookieParam['path'] = $options['cookie-path']; 817 } 818 if( isset( $options['cookie-domain'] ) ) { 819 $this->_cookieParam['domain'] = $options['cookie-domain']; 820 } 821 if( isset( $options['cookie-secure'] ) ) { 822 $this->_cookieParam['secure'] = $options['cookie-secure']; 823 } 824 792 825 // set id-prefix 793 826 if( isset( $options['id-prefix'] ) ) { branches/patSession2/patSession/Storage/Cli.php
r42 r54 58 58 59 59 // check whether the script runs as CLI processor 60 if( !isset( $_SERVER['arg v'] ) || empty( $_SERVER['argv'] )) {60 if( !isset( $_SERVER['argc'] ) ) { 61 61 patErrorManager::raiseWarning( 'patSession:Cli:1', 62 62 'Storage driver "Cli" loaded!', branches/patSession2/patSession/Storage/Native.php
r52 r54 8 8 * $Id$ 9 9 * 10 * @version 2. 0.210 * @version 2.1.0 11 11 * @package patSession 12 12 * @subpackage Storage … … 163 163 $this->_sessId = $options['id']; 164 164 } 165 166 return parent::_setOptions( $options ); 165 166 $result = parent::setOptions( $options ); 167 168 session_set_cookie_params( $this->_cookieParam['lifetime'] 169 , $this->_cookieParam['path'] 170 , $this->_cookieParam['domain'] 171 , $this->_cookieParam['secure'] 172 ); 173 174 return $result; 167 175 } 168 176 }
