From: uw
Date: Wed May 30 13:27:53 2001
Modified files:
      php-lib/php/session/session4.inc
      php-lib/php/session/session4_custom.inc

Log message:
Did I say final?


Index: php-lib/php/session/session4.inc
diff -u php-lib/php/session/session4.inc:1.8 php-lib/php/session/session4.inc:1.9
--- php-lib/php/session/session4.inc:1.8        Wed May 30 12:48:24 2001
+++ php-lib/php/session/session4.inc    Wed May 30 13:27:21 2001
@@ -7,7 +7,7 @@
 * @copyright 1998,1999 NetUSE AG, Boris Erdmann, Kristian Koehntopp
 *            2000 Teodor Cimpoesu <[EMAIL PROTECTED]>
 * @author    Teodor Cimpoesu <[EMAIL PROTECTED]>, Ulf Wendel <[EMAIL PROTECTED]>
-* @version   $Id: session4.inc,v 1.8 2001/05/30 10:48:24 uw Exp $
+* @version   $Id: session4.inc,v 1.9 2001/05/30 11:27:21 uw Exp $
 * @access    public
 * @package   PHPLib
 */ 
@@ -55,8 +55,44 @@
   */
   var $name = "";
   
+  /**
+  *
+  * @var  string
+  */
+  var $cookie_path = '/';
+  
+  
+  /**
+  *
+  * @var  strings
+  */
+  var $cookiename;
+  
+  
+  /**
+  * 
+  * @var  int
+  */
+  var $lifetime = 0;
+  
+  
+  /**
+  * If set, the domain for which the session cookie is set.
+  * 
+  * @var  string 
+  */
+  var $cookie_domain = '';
+  
   
   /**
+  *
+  * @var    string  
+  * @deprec $Id: session4.inc,v 1.9 2001/05/30 11:27:21 uw Exp $
+  */
+  var $fallback_mode;
+  
+  
+  /**
   * Was the PHP compiled using --enable-trans-sid?
   *
   * PHP 4 can automatically rewrite all URLs to append the session ID 
@@ -71,6 +107,14 @@
   
   
   /**
+  * See the session_cache_limit() options
+  * 
+  * @var  string
+  */
+  var $allowcache = 'nocache';
+  
+  
+  /**
   * Sets the session name before the session starts.
   * 
   * Make sure that all derived classes call the constructor
@@ -90,6 +134,9 @@
   */
   function start() {
     
+    $this->set_tokenname(); 
+    $this->put_headers();
+
     $ok = session_start();
     $this->id = session_id();
     
@@ -132,7 +179,7 @@
   */
   function id($sid = '') {
     
-    if ($sid = (string)$sid)) {
+    if ($sid = (string)$sid) {
     
       $this->id = $sid;
       $ok = session_id($sid);
@@ -149,7 +196,7 @@
   
   /**
   * @brother id()
-  * @deprec  $Id: session4.inc,v 1.8 2001/05/30 10:48:24 uw Exp $
+  * @deprec  $Id: session4.inc,v 1.9 2001/05/30 11:27:21 uw Exp $
   * @access public  
   */  
   function get_id($sid = '') {
@@ -209,7 +256,7 @@
   *             doesn't seem to do (looking @ the session.c:940)
   * uw: yes we should keep it to remain the same interface, but deprec. 
   *
-  * @deprec $Id: session4.inc,v 1.8 2001/05/30 10:48:24 uw Exp $
+  * @deprec $Id: session4.inc,v 1.9 2001/05/30 11:27:21 uw Exp $
   * @access public  
   * @global $HTTP_COOKIE_VARS
   */
@@ -251,7 +298,7 @@
   * @return string  rewritten url with session id included
   * @see    $trans_id_enabled
   * @global $HTTP_COOKIE_VARS
-  * @deprec $Id: session4.inc,v 1.8 2001/05/30 10:48:24 uw Exp $
+  * @deprec $Id: session4.inc,v 1.9 2001/05/30 11:27:21 uw Exp $
   * @access public  
   */
   function url($url) {
@@ -400,7 +447,7 @@
   function serialize() {
     return session_encode();
   } // end func serialze
-  
+
   
   /**
   * Import (session) variables from a string 
@@ -412,6 +459,59 @@
   function deserialize (&$data_string) {
     return session_decode($data_string);
   } // end func deserialize
+
+  /**
+  * ?
+  * 
+  */
+  function set_tokenname(){
+  
+      $this->name = ("" == $this->cookiename) ? $this->classname : $this->cookiename;
+      session_name ($this->name);
+      
+      if (!$this->cookie_domain) {
+        $this->cookie_domain = get_cfg_var ("session.cookie_domain");
+      }
+      
+      if (!$this->cookie_path && get_cfg_var('session.cookie_path')) {
+        $this->cookie_path = get_cfg_var('session.cookie_path');
+      } elseif (!$this->cookie_path) {
+        $this->cookie_path = "/";
+      }
+      
+      if ($this->lifetime > 0) {
+        $lifetime = time()+$this->lifetime*60;
+      } else {
+        $lifetime = 0;
+      }
+      
+      session_set_cookie_params($lifetime, $this->cookie_path, $this->cookie_domain);
+  } // end func set_tokenname
+  
+  
+  /**
+  * ?
+  *
+  */
+  function put_headers() {
+    # set session.cache_limiter corresponding to $this->allowcache.
+    
+    switch ($this->allowcache) {
+
+      case "passive":
+      case "public":
+        session_cache_limiter ("public");  
+        break;
+ 
+      case "private":
+        session_cache_limiter ("private"); 
+        break;
+
+      default:
+        session_cache_limiter ("nocache");  
+        break;
+    }
+  } // end func put_headers
 
   
   /**
Index: php-lib/php/session/session4_custom.inc
diff -u php-lib/php/session/session4_custom.inc:1.12 
php-lib/php/session/session4_custom.inc:1.13
--- php-lib/php/session/session4_custom.inc:1.12        Wed May 30 12:49:18 2001
+++ php-lib/php/session/session4_custom.inc     Wed May 30 13:27:22 2001
@@ -8,58 +8,14 @@
 *             2000 Teodor Cimpoesu <[EMAIL PROTECTED]>
 * @author     Maxim Derkachev <[EMAIL PROTECTED]>, Teodor Cimpoesu <[EMAIL PROTECTED]>,
 *             Ulf Wendel <[EMAIL PROTECTED]>
-* @version    $Id: session4_custom.inc,v 1.12 2001/05/30 10:49:18 uw Exp $
+* @version    $Id: session4_custom.inc,v 1.13 2001/05/30 11:27:22 uw Exp $
 * @package    PHPLib
 * @access     public
 */ 
 
 class Session4_Custom extends Session4 {
 
-  /**
-  *
-  * @var  string
-  */
-  var $cookie_path = '/';
-  
-  
-  /**
-  *
-  * @var  strings
-  */
-  var $cookiename;
-  
-  
-  /**
-  * 
-  * @var  int
-  */
-  var $lifetime = 0;
-  
-  
-  /**
-  * If set, the domain for which the session cookie is set.
-  * 
-  * @var  string 
-  */
-  var $cookie_domain = '';
-  
-  
-  /**
-  * "passive", "no", "private", "public"
-  * 
-  * @var  string
-  */
-  var $allowcache = 'passive';
-  
-  
-  /**
-  * If you allowcache, data expires in this many minutes.
-  *
-  * @var  int
-  */
-  var $allowcache_expire = 1440;
 
-
   /**
   * session storage module - user, files or mm
   * 
@@ -83,11 +39,13 @@
   */
   var $that_class = '';
   
+  
   /**
   *
   * @var  object CT_*
   */        
   var $that;
+
   
   /**
   * Purge all session data older than 1440 minutes.
@@ -96,15 +54,7 @@
   */
   var $gc_time = 1440;
 
-  
-  /**
-  *
-  * @var    string  
-  * @deprec $Id: session4_custom.inc,v 1.12 2001/05/30 10:49:18 uw Exp $
-  */
-  var $fallback_mode;
-  
-  
+
   /**
   * Garbaga collection probability
   *
@@ -121,13 +71,8 @@
   function start() {
   
     $this->set_container();
-    $this->set_tokenname(); 
-    $this->put_headers();
 
-    $ok = session_start();
-    $this->id();
-      
-    return $ok;
+    return parent::start();
   } // end func
   
   // the following functions used in session_set_save_handler
@@ -259,60 +204,6 @@
     
   } // end func set_container
 
-  
-  /**
-  * ?
-  * 
-  */
-  function set_tokenname(){
-  
-      $this->name = ("" == $this->cookiename) ? $this->classname : $this->cookiename;
-      session_name ($this->name);
-      
-      if (!$this->cookie_domain) {
-        $this->cookie_domain = get_cfg_var ("session.cookie_domain");
-      }
-      
-      if (!$this->cookie_path && get_cfg_var('session.cookie_path')) {
-        $this->cookie_path = get_cfg_var('session.cookie_path');
-      } elseif (!$this->cookie_path) {
-        $this->cookie_path = "/";
-      }
-      
-      if ($this->lifetime > 0) {
-        $lifetime = time()+$this->lifetime*60;
-      } else {
-        $lifetime = 0;
-      }
-      
-      session_set_cookie_params($lifetime, $this->cookie_path, $this->cookie_domain);
-  } // end func set_tokenname
-
-  
-  /**
-  * ?
-  *
-  */
-  function put_headers() {
-    # set session.cache_limiter corresponding to $this->allowcache.
-    
-    switch ($this->allowcache) {
-
-      case "passive":
-      case "public":
-        session_cache_limiter ("public");  
-        break;
- 
-      case "private":
-        session_cache_limiter ("private"); 
-        break;
-
-      default:
-        session_cache_limiter ("nocache");  
-        break;
-    }
-  } // end func put_headers
-  
   
   /**
   * ? 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to