I've started building a site admin page that starts at an index.php which then posts the login info to itself and then either tells the user to try again or displays the actual index page and adjusts the session to reflect that the user has now logged into the site. The page has two includes: one which searches for or creates a session (session_info.php) and another with all of the settings which won't really influence any of this posting.
The session creating page has essentially only this:
Code: Select all
<?php
session_start();
if (!isset($_GET["PHPSESSID"]) || !isset($_SESSION[ident_privileges]) || !isset($_SESSION[ident_user_id])) {
$_SESSION[ident_privileges] = $priv_guest; // $priv_guest comes from the settings page
$_SESSION[ident_user_id] = $guest_id; // $guest_id comes from the settings page
}
?>I also did some experimenting, commenting out various sections of code on different pages to see what line actually caused this to occur. The only line which, when commented out, allowed the page to load fine? session_start(), even if I didn't include session_info.php and started the session in the page navigated to.
Anyway, the thing I really don't understand: it worked fine on my machine and the server for a while and then stopped working on the server. A little while later it stopped working on my machine stopped working as well! I checked the session files themselves to see if something odd happened during the creation process, but nothing strange happened.
Any ideas? Any clarification needed?
As a side note, the hosting company has (for PHP Version 4.2.3) the following relevant settings:
Code: Select all
register_globals = on
session.auto_start = Off
session.cache_expire = 180
session.cache_limiter = nocache
session.cookie_domain = no value
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_secure = Off
session.entropy_file = no value
session.entropy_length = 0
session.gc_maxlifetime = 1440
session.gc_probability = 1
session.name = PHPSESSID
session.referer_check = no value
session.save_handler = files
session.save_path = /tmp
session.serialize_handler = php
session.use_cookies = On
session.use_trans_sid = 1
Timeouts = Connection: 3600 - Keep-Alive: 15
HTTP_KEEP_ALIVE = 300