Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace:

Diff

1666
 
1667
 
1667
 
session.php
_> 11 <?php
  22 /*
<> 3 -  $Id: session.php 1666 2007-07-19 11:55:15Z hpdl $
   3+  $Id: session.php 1667 2007-07-19 20:42:39Z hpdl $
44 
  55   osCommerce, Open Source E-Commerce Solutions
  66   http://www.oscommerce.com
     
 !
7171  */
  7272 
  7373     public function __construct($name = null) {
<> 74 -      if ( !osc_empty(basename(STORE_SESSIONS)) && file_exists(dirname(__FILE__) . '/session/' . basename(STORE_SESSIONS) . '.php') ) {
  75 -        include(dirname(__FILE__) . '/session/' . basename(STORE_SESSIONS) . '.php');
  76 -
  77 -        $class_name = 'osC_Session_' . basename(STORE_SESSIONS);
  78 -
  79 -        return new $class_name($name);
  80 -      }
  81 -
8274       $this->setName($name);
  8375       $this->_setCookieParameters();
  8476     }
     
 !
9486     }
  9587 
  9688 /**
<>  89+ * Loads the session storage handler
   90+ *
   91+ * @param string $name The name of the session
   92+ * @access public
   93+ */
   94+
   95+    public static function load($name = null) {
   96+      $class_name = 'osC_Session';
   97+
   98+      if ( !osc_empty(basename(STORE_SESSIONS)) && file_exists(dirname(__FILE__) . '/session/' . basename(STORE_SESSIONS) . '.php') ) {
   99+        include(dirname(__FILE__) . '/session/' . basename(STORE_SESSIONS) . '.php');
   100+
   101+        $class_name = 'osC_Session_' . basename(STORE_SESSIONS);
   102+      }
   103+
   104+      return new $class_name($name);
   105+    }
   106+
   107+/**
97108  * Verify an existing session ID and create or resume the session if the existing session ID is valid
  98109  *
  99110  * @access public
     
 !
164175           setcookie($this->_name, '', time()-42000, $this->getCookieParameters('path'), $this->getCookieParameters('domain'));
  165176         }
  166177 
<> 167 -        $this->_delete();
   178+        $this->delete();
168179 
  169180         return session_destroy();
  170181       }
     
 !
173184 /**
  174185  * Deletes an existing session from the storage handler
  175186  *
<> 176 - * @access protected
   187+ * @param string $id The ID of the session
   188+ * @access public
177189  */
  178190 
<> 179 -    protected function _delete() {
  180 -      if ( file_exists($this->_save_path . '/' . $this->_id) ) {
  181 -        @unlink($this->_save_path . '/' . $this->_id);
   191+    public function delete($id = null) {
   192+      if ( empty($id) ) {
   193+        $id = $this->_id;
182194       }
<>  195+
   196+      if ( file_exists($this->_save_path . '/' . $id) ) {
   197+        @unlink($this->_save_path . '/' . $id);
   198+      }
<_ 183199     }
  184200 
  185201 /**