Data output before the session_start(); is not the problem (I think).
This is what I now have, and the strangeness of it all. I have copied the program/page files into two directories and everything is identical except for the one line that governs the redirect back to the starting page. If I'm in Directory `DailyData`, the program goes to the login page on a fresh day (cookie(s) expired). I login and the data is accessed correctly. I then change to the `Lidar` directory, where I expect to be still logged in, and the page comes up saying redirect error. If I go back to the `DailyData` directory, I'm still logged in. Back to the `Lidar` directory I still get the same redirect error - page cannot be displayed. I logout from the `Lidar` directory, and it immediately takes me to the login page. Good so far. I login, and the `Lidar` data is accessible. Fine. I go back to the `DailyData` page and immediately access the data - I'm logged in. The converse is true if I wipe out session data and cookies, meaning whatever directory I start in, the other gives me a redirect error until I logout and back in, making both accessible.
The code on the top of each page is this (with the exception that the one redirect location is appropriately, I think, changed):
Code:
<?php
session_start();
$_SESSION['where'] = "http://earth.engr.ccny.cuny.edu/noaa/wc/Lidar/chainedmenu2.php";
include_once("inc/auth.inc.php");
$user = _check_auth($_COOKIE);
?>
The code for the login page is this:
Code:
<?php
session_start();
include_once("inc/auth.inc.php");
_already_logged($_COOKIE);
if(isset($_POST['submit']))
{
$user_data = _check_database(fm($_POST['user']),fm($_POST['pass']));
if($user_data == 0) login_page();
else _set_cookie($user_data,fm($_POST['rem']),session_id(),fm($_POST['user']));
} else
login_page();
?>
I think the problem has something to do with the session not being acceptable to the _check_auth($_COOKIE) function, probably that the session has changed. So.....now, any ideas? I'm confused on how to keep the sessions the same. BTW, I can't find my cookie to see if the SID is changing. Where is it? (not is C:\Documents and Settings\`user`\Cookies) Any suggestions, pleeeeeze
Bookmarks