Hello,
Great one Ben..
I would like to add that if you are running PHP on Windows then sessions will expire if the application pool refreshes. The default idle time for a pool to get refreshed is 10 minutes. This can be easily edited from the properties of Application Pool in IIS Web Server.