RE: [PHP] Refreshing session variables
| From: | John Holmes | Date: | Fri, 19 Jul 2002 00:22:08 +0000 |
| Subject: | RE: [PHP] Refreshing session variables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-108357@lists.php.net to get a copy of this message | ||
> <?
> $x = mt_rand (1000,10000);
> $y = mt_rand (1000,10000);
>
> $text = $x.$y;
> $secretstring =$x.$y;
>
> session_start();
> if(session_is_registered("secretstring")){
> session_unregister("secretstring");
> }
> session_register("secretstring");
What good do you think this does? There is no 'else' here. If
'secretstring' is registered, you unregister it, and then register it
again in the next line...
Yeah...it's going to be there with each request because register_globals
is probably on and the session value is going to take precedence over
your local value you just calculated for $secretstring because you call
session_start() after it's been set.
---John Holmes...