Forums Register Login
JSP Session

I need help with JSP session.

My problem:
I have a login page. When a user logs in then, i set a session and its expiration time. So, when the session is expired, the user will be redirected to the login page with a session expired message.
I want to identify if a page has been loaded first time by the user, or it has been loaded as a result of expiration of session.

My code:

I do the following when the user successfully logs in:

I check this in every page (i.e. check in the header of everypage)

Also when the user logs out the following code is executed:

My problem is that even when the user comes to the page for first time, it redirects the user to "login.jsp?rtype=expired" page.
You shouldn't be doing this on the pages at all. Use a servlet filter.
Well I am new to jsp, and don't have much knowledge about it. Could you please elaborate a bit and give some example?
Look up "servlet filter"
Our ServletFilters FAQ has some useful information.
This parrot is no more. It has ceased to be. Now it's a tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database

This thread has been viewed 1391 times.

All times above are in ranch (not your local) time.
The current ranch time is
Mar 24, 2019 21:16:44.