Jump to content

[SOLVED] Logout system, not working.


sharal

Recommended Posts

Hey guys, when the logout link is clicked, it logsout - but the sessions aren't destroyed.

 

<?php
session_destroy();
echo "<meta http-equiv='refresh' content='1;url=http://myurl/mysite/index.php'>"; 
?>

I've also tried with:

session_start(); at the top,

to unset the session by it's name / value.

i've checked if the sessions still exists after i've logged out with

session_start(); print_r($_SESSION);

and they do.

You might also need to know how it works when it logs in:

			$_SESSION['loggedin'] = 1;
				$_SESSION['username'] = "$username";
				$_SESSION['password'] = "$shapw";
				echo '<br />' ."logged in succesfully!";
				// insert meta redirect
				echo "<meta http-equiv='refresh' content='2;url=http://mywebpage/mysite/profile/index.php'>";
				}

 

Hope you can help me with this.

Link to comment
https://forums.phpfreaks.com/topic/174795-solved-logout-system-not-working/
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.