查了一下資料,原來最近這些新的版本真的會這樣~~
參考來源: https://secure.kitserve.org.uk/content/php-session-cookie-problems-google-chrome-and-internet-explorer
在原本的 session_start() 前面加上一些設定就可以解決了, 如下:
In keeping with best practice, I usually initialise sessions like so:
ini_set('session.use_trans_sid', false);
ini_set('session.use_cookies', true);
ini_set('session.use_only_cookies', true);
$https = false;
if(isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] != 'off') $https = true;
$dirname = rtrim(dirname($_SERVER['PHP_SELF']), '/').'/';
session_name('some_name');
session_set_cookie_params(0, $dirname, $_SERVER['HTTP_HOST'], $https, true);
session_start();
--取自參考來源網站~~