Hi everybody, I have a problem with my application. In my application I have a login page, if the user is already logged in and requests for login page, he will be automatically redirected to home.jsp. If he is not logged in he will must get authenticated.
Now after the user logins from the browser, if he opens another window and tries to login from that one the, login page is recognizing the user as already logged in, the problem is arising if the user closes the browser and again wants to login. If the user closes the browser and opens a new browser then if he request for the login page he is not redirected to home page, he is asked to get authenticated. Why is this happening? Anybody please help me.
it is happening because the default lifetime of the JSESSIONID cookie is until a user closes the browser. if you don't want this to happen create a custom cookie and based on that you can create the session and condition for redirection.
anusha chaitanya wrote:Thank you Avi, but what if the cookies are disabled. I can go with url encoding, but I don't know how to do that. Can you give me a sample example.
Thank you in advance.
well if cookies are disabled then you can implement url-rewriting easily by encoding all the urls or using <c:url value ../> (in encodes the url provided in the value) .
but in this case i can't suggest another option. wait for sometime some senior member will help you out with this.