0
我想弄清楚爲什麼這發生在Chrome瀏覽器,但不是FF或IE瀏覽器。 在以下腳本中,$ this-> referrer = $ _SESSION ['URL'];解析/第一次加載頁面,如果我刷新頁面解析到/404.php
function startSession(){
global $database; //The database connection
session_name("Training");
session_start(); //Tell PHP to start the session
/* Determine if user is logged in */
$this->logged_in = $this->checkLogin();
/**
* Set guest value to users not logged in, and update
* active guests table accordingly.
*/
if(!$this->logged_in){
$this->username = $_SESSION['username'] = GUEST_NAME;
$this->userlevel = GUEST_LEVEL;
$database->addActiveGuest($_SERVER['REMOTE_ADDR'], $this->time);
}
/* Update users last active timestamp */
else{
$this->addLogCount($this->id);
$database->addActiveUser($this->username, $this->time);
}
/* Remove inactive visitors from database */
$database->removeInactiveUsers();
$database->removeInactiveGuests();
/* Set referrer page */
if(isset($_SESSION['URL'])){
$this->referrer = $_SESSION['URL'];
}else{
$this->referrer = "/";
}
/* Set current url */
$this->url = $_SESSION['URL'] = $_SERVER['PHP_SELF'];
}
爲FF和IE瀏覽器,它首先解析爲/,然後調用頁面的地址startSession()刷新。 有沒有什麼與鉻處理這個我需要考慮到的方式?在Chrome
$會話:
Session Object
(
[id] =>
[tracksid] =>
[username] => Guest
[userid] =>
[userlevel] => 0
[time] => 1297103371
[logged_in] =>
[userinfo] => Array
(
)
[url] => /Community/login.php
[referrer] => /404.php
[type] =>
[company] =>
[ip] =>
[badip] =>
)
$會議在FireFox:
Session Object
(
[id] =>
[tracksid] =>
[username] => Guest
[userid] =>
[userlevel] => 0
[time] => 1297096106
[logged_in] =>
[userinfo] => Array
(
)
[url] => /Community/login.php
[referrer] => /Community/login.php
[type] =>
[company] =>
[ip] =>
[badip] =>
)
瀏覽器與會話無關。它只保存一個會話ID。這個問題一次可以有多個請求嗎? – 2011-02-07 17:35:13
我遇到了Chrome的幾個cookie問題,包括會話cookie。它不能解決你的問題,但它可能有助於確定會話cookie是否正確設置 – 2011-02-07 17:39:49