How to use invalidate session?

Total Post:159

Points:1117
 1702  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. 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"

      Modified On Apr-05-2018 06:42:50 AM

Answer

NEWSLETTER

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