ID: 29103 Updated by: [EMAIL PROTECTED] Reported By: allenr at houston dot rr dot com -Status: Open +Status: Bogus Bug Type: Session related Operating System: Linux PHP Version: 4.3.6 New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Thank you for your interest in PHP. Ask questions about using PHP on [EMAIL PROTECTED] Previous Comments: ------------------------------------------------------------------------ [2004-07-12 04:10:08] allenr at houston dot rr dot com Description: ------------ Using Apache/1.3.29, the header("location...") feature doesn't work after saving a session variable. I have two php scripts, login and logout. In logout, I destroy the session with session_destroy() then use the redirect to get back to the starting page. This works fine. In the login script, I verify credentials then set a session variable to indicate the user is logged in, then try the exact same redirect to the index page, this doesn't work. I've tried using "Location: http://www.google.com/" which doesn't work either. I've also entered the absolute paths to the proper scripts on my own site with the same result. Reproduce code: --------------- logout.php - works ------------------ <?php if (!session_id()) session_start(); if (isset($_SESSION['loggedIn'])) session_destroy(); header("Location: index.php"); ?> login.php excerpt - broken -------------------------- if (!strcmp($row['password'], $thisPassword) && ($row ['type'] == 1)) { $_SESSION['blah'] = true; header("Location: index.php"); exit(); } Expected result: ---------------- I expect to be redirected to the page indicated in the Location header. Actual result: -------------- The system seems to ignore the header script altogether, displaying a blank screen when it hits the exit() call. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29103&edit=1
