Пример #1
0
 function SessionManager()
 {
     global $maxWebServiceSessionLifeSpan, $maxWebServiceSessionIdleTime;
     $now = time();
     $this->maxLife = $now + $maxWebServiceSessionLifeSpan;
     $this->idleLife = $now + $maxWebServiceSessionIdleTime;
     HTTP_Session::useCookies(false);
     //disable cookie usage. may this could be moved out constructor?
     // only first invocation of following method, which is setExpire
     //have an effect and any further invocation will be have no effect.
     HTTP_Session::setExpire($this->maxLife);
     // this method replaces the new with old time if second params is true
     //otherwise it subtracts the time from previous time
     HTTP_Session::setIdle($this->idleLife, true);
 }
Пример #2
0
 /**
  * Tries to find any session id in $_GET, $_POST or $_COOKIE
  *
  * @static
  * @access private
  * @return string Session ID (if exists) or null
  */
 function detectID()
 {
     if (HTTP_Session::useCookies()) {
         if (isset($_COOKIE[HTTP_Session::name()])) {
             return $_COOKIE[HTTP_Session::name()];
         }
     } else {
         if (isset($_GET[HTTP_Session::name()])) {
             return $_GET[HTTP_Session::name()];
         }
         if (isset($_POST[HTTP_Session::name()])) {
             return $_POST[HTTP_Session::name()];
         }
     }
     return null;
 }