|
Posted by thib΄ on 11/11/65 12:00
MangroveRoot wrote:
> However, what I'm finding is that the cookie does not get set
> unless and until the visitor clicks REFRESH in the browser
> (or does anything equivalent);
This is absolutely normal. From the man':
"Cookies will not become visible until the next loading of a page that the
cookie should be visible for."
> if they don't think to do that, the cookie remains obsolete.
Well do it for them; after setcookie(), just do a header('Location: ' .
$_SERVER['PHP_SELF']) and, of course, a die().
Basically, this isn't necessary since you've got the date you need in the
$_GET. However, the refreshing method might be a better solution to avoid
the user to be prompted by his browser to resend the post data if he reloads
the page manually, for whatever reason.
Read about the PRG design pattern.
http://en.wikipedia.org/wiki/Post/Redirect/Get
http://www.theserverside.com/patterns/thread.tss?thread_id=20936
-thibΒ΄
[Back to original message]
|