Ejemplo n.º 1
0
 /**
  * Start handling session. If session does not exist - start one. If exists - do nothing.
  */
 public function sessionStart()
 {
     if ($this->session == null) {
         // create a new session
         $sessionId = UniqueStrings::timeBased();
         $cookieKey = GlobalProperties::$SESSION_COOKIE_NAME;
         $sessionSecure = GlobalProperties::$SESSION_COOKIE_SECURE;
         $cookieResult = $this->_setCookie($cookieKey, $sessionId, time() + 10000000, "/", GlobalProperties::$SESSION_COOKIE_DOMAIN, $sessionSecure);
         $session = new DB_OzoneSession();
         // set IP
         $session->setIpAddress($this->createIpString());
         // set UA hash
         $session->setUaHash($this->createUaHash());
         // set unique SESSION_ID
         $session->setSessionId($sessionId);
         $date = new ODate();
         $session->setStarted($date);
         $session->setLastAccessed($date);
         $session->setNewSession(true);
         $session->setUserId(null);
         // will this work?
         $this->session = $session;
     }
 }
Ejemplo n.º 2
0
 public function declarations()
 {
     $out = "";
     $out .= '<input type="hidden" name="formname" value="' . $this->name . '"/>';
     $out .= '<input type="hidden" name="formkey" value="' . $this->formKey . '"/>';
     $out .= '<input type="hidden" name="use_formtool" value="yes"/>';
     // put an UNIQUE key to allow resubmission detection
     $key = UniqueStrings::timeBased();
     $out .= '<input type="hidden" name="form_submission_key" value="' . $key . '"/>';
     return $out;
 }
Ejemplo n.º 3
0
 public function run()
 {
     UniqueStrings::resetCounter();
 }