I need to make log out page from my session area

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

just in case, what is in admincp? I'm beginning to think there is something bonky there.
ms_dos10
Forum Commoner
Posts: 42
Joined: Tue Jul 25, 2006 8:10 am

Post by ms_dos10 »

thanx it work now thanx for everything
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Just in case someone else might run into a session closing logout problem, can you post your solution?
ms_dos10
Forum Commoner
Posts: 42
Joined: Tue Jul 25, 2006 8:10 am

Post by ms_dos10 »

admincp.php it's a login page i redirect user to when he log out nothing on it .
thanx for helping me
ms_dos10
Forum Commoner
Posts: 42
Joined: Tue Jul 25, 2006 8:10 am

Post by ms_dos10 »

be for am not starting session that why am not found that variable , that means if not correct and am not go in inside if statement .

Code: Select all

<?php
ob_start();
session_start();
if($_SESSION['sessref'])
{

//echo "my name is : dolib";
        $_SESSION = array();
        session_unset();
        session_destroy();
      //  header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['web/student']) . 'admincp.php');
      header("location:admincp.php");
        exit();
}

ob_end_flush();
?>
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I suppose it is always helpful to actually start the session before trying to kill it, eh? :wink:
Post Reply