php sessions,logouts & the bloomin back button!


Posted on 16th Feb 2014 07:03 pm by admin

Hi All,

I've got a cms that members can log into. When they logout, the session is destroyed, however, if you click the back button, you can get back into the CMS.

Did you know?Explore Trending and Topic pages for more stories like this.
How can I get around this?
My logout code has

$_SESSION = array(); // Destroy the variables.
session_destroy(); // Destroy the session itself.
setcookie (session_name(), '', time()-300, '/', '', 0); // Destroy the cookie.

I've also tried adding this to my header file

// HTTP/1.1
header("cache-Control: no-store, no-cache, must-revalidate");
header("cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");

// This page begins the HTML header for the site.

// Start output buffering.
ob_start();

// Initialize a session.
session_start();


Am i doing something wrong?

thanks
No comments posted yet

Your Answer:

Login to answer
194 Like 53 Dislike
Previous forums Next forums
Other forums

Navigation include for all site directories
Hi,

I need a navigation include that can deal with directories at different levels on a site.

php unable to sent email
Hi, guys, I try to send a email through php but unfortunately the mail unable to sent. Here is my co

PHP Surveys
I really would like some advice.

If you have a client come to you asking for a survey to be d

empty() error
Why does

Code: empty($USER_ID = $_SESSION["USER_ID"])
create this error...

Online Event Ticket Sales
Has anyone wrote a script for online tickets sales?

I have been googling and found lots of th

Images in email problem
I found this script for sending emails, it works but if the email has <img src="image.jp

Preg_match question
I want to use preg_match to make sure a string is always 6 characters long and only contains 0-9 and

Open link with largest int string first
I have the following links i would like to open either all at once or one-by-one. How would i procee

Upload file!
Ok i have a form..
Code: <form name="form1" method="post" action=&quo

Date Question
I'm using the TIMESTAMP() function within mysql to set the date/time for certain events. However, ho

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash