Forum Moderators: coopster
and I had used that session's value in hidden field of a form as
test.html.php
<input type="hidden" name="security_code" value="<?=$_SESSION['sess_security_code']?>"> From the user notes in the manual -
The example given in this document for a "better token" should be:<?php
$better_token = uniqid(md5(rand()), true);
?>As it is now, the result isn't guaranteed to be unique, because MD5 has collisions.
Are you sure that your function is not getting called twice, as if it is then you will get 2 different values? So if you are outputting html then calling the function again then this will not work.
[edited by: PHP_Chimp at 10:05 pm (utc) on Nov. 21, 2007]