Ugh… So I’ve been working on a website for a student group at the University of Oregon. I’m developing a custom content management system for the site that uses jQuery UI and AJAX. It’s pretty spiffy actually.
Unfortunately I’ve always had problems maintaining
$_SESSION data on the University web-server. For some reason my authentication class would work fine on my dev environment, but would randomly lose and then remember the
$_SESSION data on the University web-server. This means that administrators would randomly get logged out when they were trying to update the site.
So after getting frustrated and avoiding the problem for several weeks, I finally found a solution here.
It turns out that the
session.save_path value in
php.ini was not set. The solution was to run
session_save_path() at the top of my script and set the path manually to my home directory (one level below
<?php session_save_path('/home5/twadding/session_data/'); ?>
This seems to have resolved the problem nicely. One caveat. Don’t keep your session data anywhere that is publicly accessible. Otherwise malicious users could access any of your session data on a whim.
Spending a week pouring over my code was incredibly frustrating, but at least my authentication class is nicely tuned now.
Thanks to turkguy0319 for the great image.