[phplib-dev] cvs commit From: uw (phplib-dev <email protected>)
Date: 05/30/01

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 @@
 *  <email protected> 1998,1999 NetUSE AG, Boris Erdmann, Kristian Koehntopp
 * 2000 Teodor Cimpoesu <teo <email protected>>
 *  <email protected> Teodor Cimpoesu <teo <email protected>>, Ulf Wendel <uw <email protected>>
-*  <email protected> $Id: session4.inc,v 1.8 2001/05/30 10:48:24 uw Exp $
+*  <email protected> $Id: session4.inc,v 1.9 2001/05/30 11:27:21 uw Exp $
 *  <email protected> public
 *  <email protected> PHPLib
 */
@@ -55,8 +55,44 @@
   */
   var $name = "";
   
+ /**
+ *
+ *  <email protected> string
+ */
+ var $cookie_path = '/';
+
+
+ /**
+ *
+ *  <email protected> strings
+ */
+ var $cookiename;
+
+
+ /**
+ *
+ *  <email protected> int
+ */
+ var $lifetime = 0;
+
+
+ /**
+ * If set, the domain for which the session cookie is set.
+ *
+ *  <email protected> string
+ */
+ var $cookie_domain = '';
+
   
   /**
+ *
+ *  <email protected> string
+ *  <email protected> $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
+ *
+ *  <email protected> 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 @@
   
   /**
   *  <email protected> id()
- *  <email protected> $Id: session4.inc,v 1.8 2001/05/30 10:48:24 uw Exp $
+ *  <email protected> $Id: session4.inc,v 1.9 2001/05/30 11:27:21 uw Exp $
   *  <email protected> 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.
   *
- *  <email protected> $Id: session4.inc,v 1.8 2001/05/30 10:48:24 uw Exp $
+ *  <email protected> $Id: session4.inc,v 1.9 2001/05/30 11:27:21 uw Exp $
   *  <email protected> public
   *  <email protected> $HTTP_COOKIE_VARS
   */
@@ -251,7 +298,7 @@
   *  <email protected> string rewritten url with session id included
   *  <email protected> $trans_id_enabled
   *  <email protected> $HTTP_COOKIE_VARS
- *  <email protected> $Id: session4.inc,v 1.8 2001/05/30 10:48:24 uw Exp $
+ *  <email protected> $Id: session4.inc,v 1.9 2001/05/30 11:27:21 uw Exp $
   *  <email protected> 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 <teo <email protected>>
 *  <email protected> Maxim Derkachev <kot <email protected>>, Teodor Cimpoesu <teo <email protected>>,
 * Ulf Wendel <uw <email protected>>
-*  <email protected> $Id: session4_custom.inc,v 1.12 2001/05/30 10:49:18 uw Exp $
+*  <email protected> $Id: session4_custom.inc,v 1.13 2001/05/30 11:27:22 uw Exp $
 *  <email protected> PHPLib
 *  <email protected> public
 */
 
 class Session4_Custom extends Session4 {
 
- /**
- *
- *  <email protected> string
- */
- var $cookie_path = '/';
-
-
- /**
- *
- *  <email protected> strings
- */
- var $cookiename;
-
-
- /**
- *
- *  <email protected> int
- */
- var $lifetime = 0;
-
-
- /**
- * If set, the domain for which the session cookie is set.
- *
- *  <email protected> string
- */
- var $cookie_domain = '';
-
-
- /**
- * "passive", "no", "private", "public"
- *
- *  <email protected> string
- */
- var $allowcache = 'passive';
-
-
- /**
- * If you allowcache, data expires in this many minutes.
- *
- *  <email protected> int
- */
- var $allowcache_expire = 1440;
 
-
   /**
   * session storage module - user, files or mm
   *
@@ -83,11 +39,13 @@
   */
   var $that_class = '';
   
+
   /**
   *
   *  <email protected> object CT_*
   */
   var $that;
+
   
   /**
   * Purge all session data older than 1440 minutes.
@@ -96,15 +54,7 @@
   */
   var $gc_time = 1440;
 
-
- /**
- *
- *  <email protected> string
- *  <email protected> $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: phplib-dev-unsubscribe <email protected>
For additional commands, e-mail: phplib-dev-help <email protected>