Session variables!

When your user logs in, set a session variable (session.setAttribute(...)).

On all other pages (or in an included file), check for that session
variable.  If it's not present and set properly, redirect (I think it's
response.sendRedirect("login.jsp")).

It can also be helpful to send along a parameter to login.jsp identifying
the source page, and then have login.jsp send you back to the source page
upon successful login.

-Jake

----- Original Message -----
From: "Mufaddal" <[EMAIL PROTECTED]>
To: "Tomcat List" <[EMAIL PROTECTED]>
Sent: Friday, February 14, 2003 1:00 AM
Subject: Whats a good way to solve this ... ?


> Hi,
>
> Lets say i have the following JSP pages .... Login.jsp,
> MyGirlfriends.jsp, MyStupidity.jsp, MyNotes.jsp, Welcome.jsp.
>
> Loging.jsp is accessed thru https. and then the person is taken to a
> Welcome.jsp page.
>
> Lets say the user clicks on MyNotes.jsp from Welcome.jsp.
> He likes my notes and bookmarks it and then closes his machine goes out
> to dinner and next day he wants to go back to my notes from his
> bookmarks.
>
> When he clicks on the URL to MyNotes.jsp from his bookmark .. I want to
> first let him re login to the system and then forward him to the page
> he was originally trying to access. (Essentially I would want the user
> to relogin whenever his session expires for security reasons).
>
> What would be the best way to do this ?
> If a user is going to MyNotes.jsp from his bookmarks , how do i get him
> goto my login.jsp ?
>
> Mufaddal.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to