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

  • Home
  • SEARCH
  • 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 6120279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:39:01+00:00 2026-05-23T15:39:01+00:00

I have a protected page which shows data to logged in users only, once

  • 0

I have a protected page which shows data to logged in users only, once the user clicks logout link, it destroys the session data and redirect to another page. header('Location: login.php');

Now once the page is redirected to login.php, i can easily go to back page which was protected, and can see all information there and can stay on the page untill i refresh the browser or close it.

On the websites like Gmail, and many others, once you are logged in, you can not go to back page. How this can be implemented?
Thanks.

Edit: Sorry if its unclear, the protected page has few lines of code in the top to check if the session is set or not. if the session is not set then it should redirect to the other page. but the problem is that it doesnt check the session if i hit the back button on browser.

  • 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-23T15:39:02+00:00Added an answer on May 23, 2026 at 3:39 pm

    This behavior may be caused by the default caching settings of your browser/web server.

    Whenever a user visits a protected page, try sending headers to prevent caching of the page:

    header('Cache-Control: no-cache, must-revalidate');
    header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
    

    This should usually cause any back-button presses to cause a complete reload of the page instead of loading it from the browser’s cache.

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

Sidebar

Related Questions

I have a login.jsp page which contains a login form. Once logged in the
I have a web page x.php (in a password protected area of my web
I have a set of data protected by 16bit checksums that I need to
I have a number of pages which need to support exporting data to an
I have a repeater with which I want to use to show a user
I have a aspx page in which i create reports and charts on the
if i have a protected method, can i pass in a parameter where the
I have a web service that is protected by requiring the consuming third party
Suppose I have the following declaration: class Over1 { protected: class Under1 { };
I have two classes declared like this: class Object1 { protected ulong guid; protected

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.