Jump to content

Recommended Posts

I searched the forum, only found 1 vaguely relevant post and it was about sessions wrt to cookies. So if I missed something, let me know.

 

Is this teh best way to clear sessions in your opinion?

 

This is the code in my logout file.

<?php
session_start();
session_regenerate_id(TRUE);
$_SESSION = array();
header('Location: /'); exit();
?>

Link to comment
https://forums.phpfreaks.com/topic/164579-solved-clearing-sessions/
Share on other sites

Yeah, I used that and it didn't work.

 

If you'd like to help me figure out why, I'm up for it. Maybe it was the order of everything?

 

It used to look like this:

<?php
session_start();
session_destroy();
header('Location: /'); exit();
?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.