views:

48

answers:

2

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 different 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?

+1  A: 

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.

roryf
before using the javascript code to update session it was working fine. I have a code that fill the session when the user log in and one that empty it when the user log out. So I'm sure it is coz of js.
zeina
Updating session data and setting cookies are entirely different, one is server-side and one client-side. The cross-over is that your session identifier is probably stored in a cookie.
roryf
Rory: what do you mean by "your session identifier" ?Anyway to fix that?
zeina
It entirely depends on your implementation, no-one will be able to tell you any more without knowing that.
roryf
A: 

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".

brian d foy