Re: Does browser support cookies?
| From: | Stephen Hui | Date: | Thu, 22 Jun 2000 13:23:44 +0000 |
| Subject: | Re: Does browser support cookies? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-2619@lists.php.net to get a copy of this message | ||
You could have an initial PHP script that sets a cookie, then redirects
to a second script which checks for the cookie the first script tried to
set. If the second script detects the cookie, then continue doing
whatever you need to be doing. Otherwise, handle the lack of cookie
support however you need to.
You would only need to set a test cookie once. (If possible, you could
try to set the cookie value you need straight away instead of setting a
"dummy" cookie, then check to see if the cookie is valid.) Every
subsequent page in the site would check for the cookie and handle the
presence/absence of the cookie appropriately.
I do exactly this in one of my sites, and it works beautifully. At any
point in the site, the scripts will detect when a cookie dies or cookie
support is disabled every time a new page is loaded or the current page
is refreshed.
Hope this helps.
Stephen.
MK wrote:
>
> Is there a way in PHP3 to tell if a browser supports cookies.
>
> If not a clean way, then is there a script that someone could refer me to?
>
> thanks in advance.
>
> --
> Michael Kolodenko
--
Computer Terms: Programmer - A red-eyed, mumbling mammal
capable of conversing with inanimate objects.
Stephen Hui, ARL:UT, Austin, TX