Changeset View
Changeset View
Standalone View
Standalone View
branches/5.3.x/core/kernel/session/session.php
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Line(s) | |||||
... | ... | ||||
//link output: | //link output: | ||||
echo "<a href='index.php?'". ( $session->NeedQueryString() ? 'sid='.$session->SID : '' ) .">My Link</a>"; | echo "<a href='index.php?'". ( $session->NeedQueryString() ? 'sid='.$session->SID : '' ) .">My Link</a>"; | ||||
*/ | */ | ||||
class Session extends kBase { | class BaseSession extends kBase | ||||
{ | |||||
const smAUTO = 1; | const smAUTO = 1; | ||||
const smCOOKIES_ONLY = 2; | const smCOOKIES_ONLY = 2; | ||||
const smGET_ONLY = 3; | const smGET_ONLY = 3; | ||||
const smCOOKIES_AND_GET = 4; | const smCOOKIES_AND_GET = 4; | ||||
var $Checkers; | var $Checkers; | ||||
Show All 21 Lines | |||||
* | * | ||||
* @var bool | * @var bool | ||||
*/ | */ | ||||
var $_fromGet = false; | var $_fromGet = false; | ||||
/** | /** | ||||
* Enter description here... | * Enter description here... | ||||
* | * | ||||
* @var SessionStorage | * @var BaseSessionStorage | ||||
* @access protected | * @access protected | ||||
*/ | */ | ||||
protected $Storage; | protected $Storage; | ||||
var $CachedNeedQueryString = null; | var $CachedNeedQueryString = null; | ||||
/** | /** | ||||
* Session Data array | * Session Data array | ||||
▲ Show 20 Lines • Show All 204 Lines • ▼ Show 20 Line(s) | |||||
function CheckIfCookiesAreOn() | function CheckIfCookiesAreOn() | ||||
{ | { | ||||
if ( $this->Mode == self::smGET_ONLY ) { | if ( $this->Mode == self::smGET_ONLY ) { | ||||
//we don't need to bother checking if we would not use it | //we don't need to bother checking if we would not use it | ||||
$this->CookiesEnabled = false; | $this->CookiesEnabled = false; | ||||
return false; | return false; | ||||
} | } | ||||
$http_query = $this->Application->recallObject('HTTPQuery'); | $http_query = $this->Application->recallObject('kHTTPQuery'); | ||||
/* @var $http_query kHTTPQuery */ | /* @var $http_query kHTTPQuery */ | ||||
$cookies_on = array_key_exists('cookies_on', $http_query->Cookie); // not good here | $cookies_on = array_key_exists('cookies_on', $http_query->Cookie); // not good here | ||||
$get_sid = getArrayValue($http_query->Get, $this->GETName); | $get_sid = getArrayValue($http_query->Get, $this->GETName); | ||||
if ( ($this->Application->HttpQuery->IsHTTPSRedirect() && $get_sid) || $this->getFlashSID() ) { // Redirect from http to https on different domain OR flash uploader | if ( ($this->Application->HttpQuery->IsHTTPSRedirect() && $get_sid) || $this->getFlashSID() ) { // Redirect from http to https on different domain OR flash uploader | ||||
$this->OriginalMode = $this->Mode; | $this->OriginalMode = $this->Mode; | ||||
▲ Show 20 Lines • Show All 105 Lines • ▼ Show 20 Line(s) | |||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
} | } | ||||
function getFlashSID() | function getFlashSID() | ||||
{ | { | ||||
$http_query = $this->Application->recallObject('HTTPQuery'); | $http_query = $this->Application->recallObject('kHTTPQuery'); | ||||
/* @var $http_query kHTTPQuery */ | /* @var $http_query kHTTPQuery */ | ||||
return getArrayValue($http_query->Post, 'flashsid'); | return getArrayValue($http_query->Post, 'flashsid'); | ||||
} | } | ||||
function GetPassedSIDValue($use_cache = 1) | function GetPassedSIDValue($use_cache = 1) | ||||
{ | { | ||||
if (!empty($this->CachedSID) && $use_cache) { | if (!empty($this->CachedSID) && $use_cache) { | ||||
return $this->CachedSID; | return $this->CachedSID; | ||||
} | } | ||||
// flash sid overrides regular sid | // flash sid overrides regular sid | ||||
$get_sid = $this->getFlashSID(); | $get_sid = $this->getFlashSID(); | ||||
if (!$get_sid) { | if (!$get_sid) { | ||||
$http_query = $this->Application->recallObject('HTTPQuery'); | $http_query = $this->Application->recallObject('kHTTPQuery'); | ||||
/* @var $http_query kHTTPQuery */ | /* @var $http_query kHTTPQuery */ | ||||
$get_sid = getArrayValue($http_query->Get, $this->GETName); | $get_sid = getArrayValue($http_query->Get, $this->GETName); | ||||
} | } | ||||
$sid_from_get = $get_sid ? true : false; | $sid_from_get = $get_sid ? true : false; | ||||
if ($this->Application->GetVar('admin') == 1 && $get_sid) { | if ($this->Application->GetVar('admin') == 1 && $get_sid) { | ||||
▲ Show 20 Lines • Show All 651 Lines • Show Last 20 Lines |