frosty1433 Posted April 7, 2007 Share Posted April 7, 2007 I have been working on this for 4 days now and I am getting very frustrated... I'm using session_set_save_handler to store session data in a database, but it seems to be storing something completely different than intended. I'm trying to generate a random MD5 hash everytime the page is loaded... I save it in a session called "session_hash_key"... Reload the page, and session_hash_key is something else (but not before generating a new one). I've taken action to verify I'm not generating the hash twice by echoing the data to be inserted into the DB before insertion, and it looks fine... example: http://www.mihopa.net/mihopa/login/register/ Refresh the page, and "session_hash_key old" should be what the new one used to be... Wtf is going on here?! Link to comment https://forums.phpfreaks.com/topic/45983-have-i-uncovered-a-bug/ Share on other sites More sharing options...
tippy_102 Posted April 7, 2007 Share Posted April 7, 2007 It looks like it's getting updated. Can you post your code? Link to comment https://forums.phpfreaks.com/topic/45983-have-i-uncovered-a-bug/#findComment-223455 Share on other sites More sharing options...
frosty1433 Posted April 7, 2007 Author Share Posted April 7, 2007 All 900 lines? Link to comment https://forums.phpfreaks.com/topic/45983-have-i-uncovered-a-bug/#findComment-223456 Share on other sites More sharing options...
frosty1433 Posted April 7, 2007 Author Share Posted April 7, 2007 I don't know how it can be getting updated, because I've required it to echo the session data before inserting into the DB. Link to comment https://forums.phpfreaks.com/topic/45983-have-i-uncovered-a-bug/#findComment-223457 Share on other sites More sharing options...
frosty1433 Posted April 7, 2007 Author Share Posted April 7, 2007 With further inspection, I have uncovered that everything is being done twice... And thanks to a bug in my template system, it's only showing the first one, which is why it seemed not to be generating twice. I found this out by having the script write the session data to a text file, instead of echoing, and sure enough two values were added per refresh. 1) the expected value, and 2) the value that was being inserted. So, I guess I have uncovered a bug, but in my own code. Thanks for helping... Link to comment https://forums.phpfreaks.com/topic/45983-have-i-uncovered-a-bug/#findComment-223465 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.