When a user visits a certain page on my site the script below runs once. This works perfectly, but for some reason after it runs the one time, the session is cleared and is set to "0".
The session name is "user_zip" and here is the code that is somehow clearing the session.
$user_zip_query = "SELECT * FROM dev_cities WHERE city_zip = '".$_SESSION['user_zip']."'";
$user_zip = mysql_query($user_zip_query);
$userziprow = mysql_fetch_assoc($user_zip);
$state = $userziprow['city_state'];
$county = $userziprow['city_county'];
$city = $userziprow['city_name'];
Any idea what could be causing this?
The Session is started in an included class file with this code...
public function __construct() {
include_once("includes/userconfig.php"); // include database constants
if ($this->checkDatabase()) { // check for database connection
session_start(); // create session