48 ini_set(
"session.cookie_httponly", 1);
49 if(version_compare(PHP_VERSION,
'7.1.0',
'>=')) {
50 ini_set(
"session.sid_length",
"32");
53 ini_set(
"session.hash_bits_per_character",
"4");
57 session_name(isset($sessionName)
66 if (strlen(session_id()) < 32)
68 mt_srand ((
double)microtime()*1000000);
69 session_id(md5(uniqid(mt_rand())));
75 if ( isset(
$_COOKIE[session_name()]) &&
76 @strlen(
$_COOKIE[session_name()]) >= 32
84 $query = @
$_SERVER[
"QUERY_STRING"] !=
"" ?
"?".$_SERVER[
"QUERY_STRING"] :
"";
86 header(
"Status: 302 Found");
102 ### ------------------------------------------------------- 112 header(
"Expires: Sat, 05 Aug 2000 22:27:00 GMT");
113 header(
"Last-Modified: " . gmdate(
"D, d M Y H:i:s") .
" GMT");
114 header(
"Cache-Control: no-cache, must-revalidate");
115 header(
"Pragma: no-cache");
116 header(
"Cache-Control: post-check=0, pre-check=0");
119 ### ------------------------------------------------------- 136 if ($pathInfo[0] !=
"/")
137 { $pathInfo = substr(getenv(
"PATH_INFO"),
139 strrpos(getenv(
"PATH_INFO"),
"/")+1
145 $port = !preg_match(
"/^(80|443)$/",
146 getenv(
"SERVER_PORT"),
148 ?
":".getenv(
"SERVER_PORT")
153 .(($portMatch[1] == 443) ?
"https://" :
"http://")
154 .
$_SERVER[
"HTTP_HOST"].$port.$this->url($pathInfo));
158 ### ------------------------------------------------------- 166 $dummy = preg_match(
"/(.*)(?<!&|\?)/",$pathInfo,$match);
170 ### ------------------------------------------------------- 178 if ($this->usesCookies || $this->transSID)
return $pathInfo;
181 $dummyArray = explode(
"#", $pathInfo);
182 $pathInfo = $dummyArray[0];
185 $pathInfo = preg_replace(
"/[?|&]".session_name().
"=[^&]*/",
190 if (preg_match(
"/&/",$pathInfo) && !preg_match(
"/\?/",$pathInfo))
193 $pathInfo = preg_replace(
"/&/",
"?",$pathInfo,1);
200 $pathInfo .= preg_match(
"/\?/",$pathInfo) ?
"&" :
"?";
203 $pathInfo .= isset($dummyArray[1]) ?
"#".$dummyArray[1] :
"";
url($pathInfo)
Fallback via GET - wenn Cookies ausgeschaltet sind.
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
__construct($sessionName="SESSID")
Konstruktor - nimmt, wenn gewuenscht einen neuen Session-Namen entgegen.
sendNoCacheHeader()
Cacheing unterbinden.
redirectTo($pathInfo)
HTTP-Redirect ausführen (header("Location: ...")
removeTrail($pathInfo)
Entfernt mögliche abschließende "&" und "?".
Add a drawing to the header
"Manueller" Session-Fallback mit PHP4