HOW TO USE INVALIDATE SESSION?

Samuel Fernandes

Total Post:159

Points:1117
Posted by  Samuel Fernandes
 1370  View(s)
Ratings:
Rate this:

When do you call getPageContext().getSession().invalidate()?

I tried calling that at the logout page, then cflocation it back to the main page, and it throws exception.

How to assign a new session right after?

  1. Kamlakar Singh

    Post:194

    Points:1396
    Re: How to use invalidate session?

    getPageContext().getSession().invalidate() will invalidate the session, subsequent request with that sessionID will get an error trying to access the Session scope but the memory will not be reclaimed until the actual session timeout.

    What you can do is session.setMaxInactiveInterval(int) set it to very a low number in ms so it expires right away and release the memory. Then do a cflocation and for safe mesure use addToken="no"

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!