Hi cjm771,
In your login form, you're setting the action of the form to:
/login.php?url=<?echo $_GET['url']?>
The form sends its data to the server via HTTP POST and you have a URI string that would usually be sent via a HTTP GET.
It usually works, but maybe Safari isn't sending the url param for some reason?
What you could do is use a hidden field instead of appending it to the url.
<input type="hidden" name="url" value="<?php echo $_POST['url']; ?>" />
but for some strange reason if there is $_GET['url'], the session is only set for the pages in the /cp directory, even if the $_GET['url'] is in the same directory as login.php.
Isnt sessions limited only by domain? It doesnt matter which directory is it.
The frequent problem is if you redirect to say:
http://www.example.com/ when you set the session for
http://example.com
Browsers treat
www.example.com as a different domain from example.com
Its a bit hard to read your code, I suggest you seperate the database connection into a seperate class or function. Maybe just calling functions instead of making database calls in login.php (so that all the functions that call the database are in config.php or a seperate file). Just a suggestion.