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

Calculus Help (and by help I mean homework)
Hrmmm, I hate posting about math homework, partly because it's homework, and partly because I hate w

Better Method of a Member Cloud
I assume most people know how tag clouds work, where the tags most used are bigger and the least use

Checking if multidimensional array is empty?
I have a for with multiple test input fields. Specifically the user submits multiple names and ages

Namespace Problem
I'm having problem with a section of code with a variable namespace.

This code works fine:

Why does this file not return file names that start with numbers?
This file returns a list of filenames to help populate a drop down in my form. For some reason it ig

need to apply an if/else statement to Tim Thumb script
Not sure how to work this. I essentially want to call a variety of image sizes based on which style

Creating a function
Basically i wanna put all this code in a seperate file

Code: <?php

Cannot Connect to Database
I am writing an application to do annual reviews. I cannot get my script to work. Whenever it runs I

PHP Include w/If IE Condition Statement?
I was having a problem with Internet Exploder (big surprise, right?) displaying my drop down menus i

RSS poster script?
I have found a script that posts RSS's for me on a site that I'm building. However I would like to a

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