开发者

Why isn't my Javascript setting the right cookie?

On my application, a session is created whenever the user is logged in, and this session is updated on the db and session is saved on cookies as well (using perl)

Now I modified the code to update the session using javascript. However when I log out then in again, the session found in the database is dif开发者_运维知识库ferent from that found in the cookies. For some reason the cookies is not being updated using Perl after it is being updated using javascript. I don't what wrong I'm doing.

In javascript I do this:

createCookie(cookie_name,cookies_value);// where cookie_name is same as the one on Perl

Any help?


Sessions are normally lost when you log out of a web app, so it's expected to get a new one when you log in again. Without knowing your session implementation and login/logout code, there's no way of knowing if that's the cause of the issue.


What cookies are sent with the request? Which cookies are stored by the browser? Verify everything by inspecting the HTTP transaction, etc. then tell us what you find. Be a lot more specific than "It doesn't work".

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜