Jump to content

have i uncovered a bug?!


frosty1433

Recommended Posts

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

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...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.