Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7532843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:34:13+00:00 2026-05-30T05:34:13+00:00

I am developing a web application, in which I have used session management to

  • 0

I am developing a web application, in which I have used session management to store some values.

What I am looking for is, after a user login to the application by giving username and password, s/he will be on the home page, but at any moment if the user closes the browser window or pressed the back button, the session should get invalidated and the user should not get the home page again.

I am using servlet as controller for login(jsp) and 2 jsp pages, 1st-login page, 2nd- home page.

For timeout I am using web.xml’s <session-timeout> functionality.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T05:34:15+00:00Added an answer on May 30, 2026 at 5:34 am

    Invalidate session when pressed back button on IE JSP

    How about the other browsers? There are many more browsers in the world than only IE.

    Anyway, you’re going the wrong direction as to solving the “problem”. It’s technically not reliably possible to invalidate the session when the user presses the back button. Further, I’m not sure how you usually browse on the net, but I’m pretty sure that invalidating the session on pressing the back button would astonish the average webpage visitor.

    If your concrete problem is that you’d like to prevent the enduser from viewing a restricted page which requires a login after pressing the back button, then you need to just tell the browser to not cache those pages. This is in detail answered here: Prevent user from seeing previously visited secured page after logout

    As to invalidating the session as well when the user physically closes the browser, this is technically also not reliably possible. The common approach is to just keep the session timeout relatively short, for example 1 minute, and to introduce an ajax poll which sends every 55 seconds or so a request to the server to keep the session alive. This is in detail answered here: JSF – Keep a session alive for an indefinite amount of time

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a web application which has Chart Controls. I have developed a
I'm currently involved with developing a C# CMS-like web application which will be used
I have been developing a web application for almost a year which I had
I'm developing a web application which have a online forum with it. I'm going
I am developing a web application, in which I have the following type of
I am developing an application which is web-based (asp.net MVC). The user configures reminders
Am developing an android web application which have to access an database in the
We are developing a web application which is available in 3 languages. There are
When developing a new web based application which version of html should you aim
I'm developing a web application for a company which I work for. My team

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.