Your Ad Here

Monday, August 24, 2009

Simple login using php (part 4)

Here i will explain about logging out of the session.

<?php
//session starts here
session_start();

//makes sure userid is registered
if(session_is_registered('userid')){

//if session is registered only then user can log out
session_unset();
}
session_destroy();
else{

//if user is not registered then the logout should not work and redirect user to login page
header( "Location: http://login.html" );
}
?>

2 comments until now.

Buy Contact Lenses + July 20, 2017 at 1:54 AM (#) :

very informative post for me as I am always looking for new content that can help me and my knowledge grow better.

GST Training + August 9, 2017 at 1:58 AM (#) :

Amazing blog and very interesting stuff you got here! I definitely learned a lot from reading through some of your earlier posts as well and decided to drop a comment on this one!

Post a Comment