I've looked around on the internet, including stack overflow, for a few days trying to resolve my issue with PHP sessions. For one, I've noticed that most of the tutorials simply say "Here's the code, go use it." and not so much "This is how it works." Additionally, all of the issues/answers I find seem to be about information being lost on refresh or after switching pages and none of these apply to me.
The data in $_SESSION is being stored/loaded no matter which page I view. My issue is, when I view the session files on the server, there is no data in them. Additionally, when I destroy a session or unset the variables the information is still stored and the next time $_SESSION is accessed the old information is retrieved.
To troubleshoot the behavior of sessions on my server I created an extremely simple script:
<?php
// Use $HTTP_SESSION_VARS with PHP 4.0.6 or less
if (!isset($_SESSION['count'])) {
$_SESSION['count'] = 0;
} else {
$_SESSION['count']++;
}
echo $_SESSION['count'];
?>
This is ALL of the code on the page (viewable here: ). Every time this page is refreshed a new, blank, session file is saved into the specified directory on the server and the counter does not increase.
More information:
For information regarding php install:
Hosted on GoDaddy Shared Hosting - Linux OS
I will update the permissions on the phpsessions directory to be temporarily browseable shortly. ()