If the servlet doesn't set the session time,when the user close the browser,the
session will automatically expired.But if the servlet set the session time say 30
minutes,and user close the brower only in 15 minutes,how to invalidate the
session?which  method to invoke when the user close the browser?

Thanks in advance,
chris

"G.Nagarajan" wrote:

> If the browser window is closed, the browser does not send the session
> cookie.
> but the session objects would still be in the server until the session times
> out.
> So it is good to invalidate the session.
>
> So it is better to redirect the user to a logout servlet or jsp which
> invalidates the session and displays the logged out message.
>
> regards,
> Nagaraj.
>
> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Lorena Carlo
> Sent: Wednesday, November 29, 2000 4:18 PM
> To: [EMAIL PROTECTED]
> Subject: a doubt on sessions
>
> Hello all,
>
> I have a doubt on session, can any body tell me if it is necesary to
> invalidate a session when the user  presses a button that have a the
> following javascript code:   "javascript:window.top.close()", that closes
> the browser window?.
>
> If I have to invalidate the session, how can i do it with javascript, i can
> not use the method invalidate of the HttpSession object because I am using
> html for the menues and not jsp, what can I do in that case.
>
> Thanks in advace
>
> Lorena
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to