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.

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

writing a screen scraper
Hello,

I'm writing a screen scraper application and want to be able to get absolute addresses

my two tables
table1 : col1 = topicid , col2 = topic

table2 : col1 = sentid, col2 = sentence

Cod

problem with sql querry in php script
Hello guys,

What I want to do is I want to read out a csv file and then but te conent ot the

Dynamic Data + Sql Server 2005 Enterprise?
Hi! I have just started to learn ASP.NET, and it looks like it is quite a lot to learn. Im not reall

How would I protect......
I have a from, actually, a good amount of forms. How can I make it so you can't type the characters:

recrawling
Can anyone suggest me how may i know a page is updated before it is being downloaded, so that i can

PHP & Java
Hello,

can PHP code be used inside java code?

Code: <SCRIPT LANGUAGE="Java

Question about GD library
I am trying to make an image that shows a random quote from my database.


However I want t

Career Change into SAP
Hai
I am sajesh ,did my diploma in Mechatronics i have a 4 years of experience in

Calling All PHPFREAKS Blackberry Users
Are you a member of PHPFreaks and have a blackberry? Well RIM just recently released Blackberry Mes

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