Jump to content

[SOLVED] Clearing sessions


soycharliente

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();
?>

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.