Asperon Posted June 21, 2009 Share Posted June 21, 2009 <?php session_start(); if(!isset($_SESSION['time'])){ $_SESSION['time'] = time(); } echo $_SESSION['time']; ?> For some reason, this code will resave time() in the $_SESSION['time']. It does not stay set between refreshes. I was using date earlier, but realized that $_SESSION could not hold an object so I started using time instead. Also, later, at the end of the script I reset the $_SESSION['time'] based on the last saved data entry in my MySQL table, which is also an integer, so it should still be set. Any ideas? P.S. Let me know if you need to see the whole script Link to comment https://forums.phpfreaks.com/topic/163081-odd-session-behavior/ Share on other sites More sharing options...
Asperon Posted June 21, 2009 Author Share Posted June 21, 2009 Well, I figured it out, thanks again. Link to comment https://forums.phpfreaks.com/topic/163081-odd-session-behavior/#findComment-860466 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.