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

ORA-01017: invalid username/password; logon denied
Dear All,

I am facing problem in taken backup from db13 it comes up with the following l

Form Help
Here is the form:

Line number On/Off | Expand/Contract<? include("../include/sess

rand() function
just a general question guys a girls, is the rand() function 100% random or is it based on time?

Track downloads' status
Hello,

I need to make somehow, some system, to track whether downloads are completed or faile

in php, link returns to the line
When I add a link in a php page, the link word returns to the line (as a
would do)

Examp

Share admin accross websites
I'm using .net memberships and roles in one of my sites, but I need to be able to share logins and p

how can i make a .gif images for my site
Dear Friends ,

Pls solve my problem , I am starting making new site but i dont know how can i

uploading video files into mysql in php
hi,
I have the video files which i have to upload into mysql db. along with creating thumbnails f

SESSION CHECK WORKS "MOST" of the time... whats going on?
i have a sign in check thats included in every page that is a members only page which is basically a

Forgot password won't work
My forgot password thing is not working properly. It is giving me this errorMailbox unavailable. The

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