I have 3 tabs. Home, tab1, tab2. When user launches the app, its directed to Home tab & I create a new session using HttpSession session = request.getSession();
When user browses to other tabs, I maintain the session using HttpSession session = request.getSession(false);
Now if the user click back on Home tab, I want to destroy the previous session and start fresh with new session. Please tell me how to do it?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
in jsp you can reset the session with
after that give the user a new one
Replace the code behind home tab by
This is however a bit odd approach. I would rather put an attribute in the session and then intercept on its presence instead.
first use session.invalidate(); to destroy session
request.getSession(true); will create new session if there is no session
You could use session.invalidate()