开发者

multiple sessions are opened for one visitor

LAMP test server - only I am visiting it:

I have a website and for some reason I get multiple sessions per user (browser). I am browsing the page with one browser only 开发者_JAVA技巧and I get 5-6-7-8 session files in /tmp. What can be the reason for it?

Sessions are simple file based sessions. I noticed that I get multiple sessions when I update a session variable (current page # is stored in $_SESSION['pagepos']). Updating a session variable for the current user should update the session file and should not create a new session file, right? My session id in the browser remains the same.

Thanks, Hamlet


If you use flash that requests something from the server (xml/other swf files), then it probably doesn't send any cookies with it and thus - new session is started with each request.


A session being created anew every time would make me think that the session cookie is refused by the browser. Check what cookies you take on board (I use Firecookie, but there are many such extensions for the 'fox).

It happened to me once, and in the end I found I should have left session.cookie_domain commented out in my php.ini


I would check to make sure your AJAX calls are using the same session name. Sometimes you need to add the session name in form post or get data.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜