i upload my website on server that using php5/IIS6 and logout function not working code im using for logout is following but its working fine on my local where im using php5/apache.
code:
session_start();
// i also tried to empy session variables
$_SESSION['LogedStatus'] = "";
$_SESSION['LogedUser'] = "";
$_SESSION['LogedUserID'] = "";
//also tried to uset session variables
unset($_SESSION['LogedStatus']);
unset($_SESSION['LogedUser']);
unset($_SESSION['LogedUserID']);
//also tried to unset session itself
session_unset();
session_destroy();
//also tried this
session_write_close();
header("Location: " . $_REQUEST['ru']);
all this code working fine on my local php5/apache2 but on server it dosnt work. plz tell me if i need to do something with php.ini on server or any thing im doing wrong ? im quite confident abt code cuz same task i done hundarad times but with IIS im using first time bit weared need help guys???????
Logout dos'nt work with PHP5/IIS6
Moderator: General Moderators
-
mickeymick
- Forum Newbie
- Posts: 1
- Joined: Tue Jul 08, 2008 9:17 am
Re: Logout dos'nt work with PHP5/IIS6
You gotta delete the session cookie I'm assuming.
This code should kill the session
This code should kill the session
Code: Select all
session_start();
//empty the session
if(isset($_COOKIE[session_name()]))
{
setcookie(session_name(), '', time()-42000, '/');
}
if(!empty($_SESSION))
{
session_destroy();
}
$_SESSION = array();Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.