Sessions and IIS - Issues with passing between 2 pages
Posted: Thu Jun 08, 2006 2:20 pm
Hey all,
So I have a page with a login/user authentication system. I am using a derivative of the challenge/response tutorial on this very forum. It is a great starting point.
My problem now is that I am on a Windows server hosting plan and as many of you may know, there are some issues passing session ID's between two pages on IIS. Whenever I refresh the page or I go to another page, it resets the sessionID. This kinda throws session tracking out the window. I was wondering if anyone has a solution for this.
Pertinent code:
index.php
login.php
The if statement in the second code snippet does not fire. I also had it print out the session id's on both pages, and they were different. This happens at page change and refresh.
Anyone got an idea for a solution? If not I'm just going to pass the session id with the form and set a cookie that the user is logged in.. I would just like to use sessions and not cookies if at all possible.
Thanks,
Janson
So I have a page with a login/user authentication system. I am using a derivative of the challenge/response tutorial on this very forum. It is a great starting point.
My problem now is that I am on a Windows server hosting plan and as many of you may know, there are some issues passing session ID's between two pages on IIS. Whenever I refresh the page or I go to another page, it resets the sessionID. This kinda throws session tracking out the window. I was wondering if anyone has a solution for this.
Pertinent code:
index.php
Code: Select all
<?php
/*
Start the PHP Session
*/
session_start();
session_register("access_time");
$access_time = time();
session_write_close();
include("database.php");
?>Code: Select all
<?php
session_start();
/*
Start the PHP Session
*/
if (isset($_SESSION['access_time']))
{
echo("It's set...");
}Anyone got an idea for a solution? If not I'm just going to pass the session id with the form and set a cookie that the user is logged in.. I would just like to use sessions and not cookies if at all possible.
Thanks,
Janson