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 7687869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:47:44+00:00 2026-05-31T19:47:44+00:00

I want to create a logout action in JSPs such that there is no

  • 0

I want to create a logout action in JSPs such that there is no back action. Presently, I am using session.invalidate method to kill my existing session and directing to login page.

But that doesn’t prevent the page getting loaded if the user presses the back button. After searching I came to know that something like SSL is used for that purpose. Can anyone tell me what is SSL(other than it’s full-form 🙂 (Secure Socket Layer) )? How is it used?

Other than that, after much searching I found this code

<%
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>

I am keeping this code in beginning of body tag, but it is not working. What could be the error? I even tried with “no-store” in place of “no-cache”? Can anyone help me what more change or where should I keep that particular code?
Other than this, is anyone having another solution?

Thanks in advance.

  • 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-31T19:47:45+00:00Added an answer on May 31, 2026 at 7:47 pm

    The Cache-Control header is incomplete. It must also contain no-store and must-revalidate.

    response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1.
    

    See also:

    • Prevent user from seeing previously visited secured page after logout

    Please note that those headers needs to be set on every request which requires a login. Much easier is to have a single servlet filter for that so that you don’t need to copypaste the same piece of code over all JSP pages. The abovementioned link contains a concrete example. You can do that in the very same filter as where you’re checking the logged-in user, if you have any. Writing Java code inside a JSP file is a poor practice anyway.

    SSL (read: HTTPS instead of HTTP) is only useful to prevent man-in-the-middle attacks wherein the entire HTTP traffic is been captured and read by some malicious proxy, router, virus or something in the middle of the network traffic. Any potentially sensitive information such as submitted login data and the retrieved response are then visible as plaintext to the attacker. SSL will encrypt this traffic so that it’s unreadable to the attacker. It does nothing with regard to caching and authentication. SSL is to be configured at server level, not at webapp level. Read the server documentation for details. E.g. Tomcat 7.0 SSL HOW-TO for Tomcat 7.0.x.

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

Sidebar

Related Questions

I want to create an application in which i want a login logout authentication
I am trying ebook reading app. In that I want create UIActionSheet by clicking
I want to create a simple affiliate code. Currently I use PHP session to
i want to create users for my webapplication. im using symfony. i wonder if
I want to create a secure login/logout mechanism. I started reading the following articles
I want to create a website where someone can login and logout, upload and
Goal I want to create a web app with a horizontal GUI bar that
i want create a counter that retrieve the number of month, day, hour, minute
I want create an array in JSF EL. How can I do that? Is
I want create a script, running in a cron to perform a task that

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.