Jump to content

[SOLVED] Destroyed session still visible


frost

Recommended Posts

Hello,

 

After destroying a session using:

 

<?php
// Initialize the session.
// If you are using session_name("something"), don't forget it now!
session_start();

// Unset all of the session variables.
$_SESSION = array();

// If it's desired to kill the session, also delete the session cookie.
// Note: This will destroy the session, and not just the session data!
if (isset($_COOKIE[session_name()])) {
    setcookie(session_name(), '', time()-42000, '/');
}
session_unset();
// Finally, destroy the session.
session_destroy();
header("Location: ./?");
?>

 

I can simply hit the back button and all of the information is still visible. Is there a way around this?

 

Edit: A refresh will clear all of the values but I was hoping to get it done without the refresh.

Link to comment
https://forums.phpfreaks.com/topic/87473-solved-destroyed-session-still-visible/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.