如果你的浏览器Cookie保存的地方找不到的PHPSESSID这个变量,那就的Session就是不可用的,请看看PHP.ini的设置
; Whether to use cookies.
session.use_cookies = 1
;session.cookie_secure =
; This option enables administrators to make their users invulnerable to
; attacks which involve passing session ids in URLs; defaults to 0.
; session.use_only_cookies = 1
; Name of the session (used as cookie name).
session.name = PHPSESSID
; Initialize session on request startup.
session.auto_start = 0
; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0
; The path for which the cookie is valid.
session.cookie_path = /
; The domain for which the cookie is valid.
session.cookie_domain = 我的原来是
session.cookie_domain = /
记住一定要去掉/,才可以使用
奇妙的PHP