Re: [PHP] How to ensure cookies are turned on.

2004-11-29 Thread Marek Kilimajer
M. Sokolewicz wrote:
Marek Kilimajer wrote:
Gary Reimer wrote:
Hello;
I’m working on a website that uses sessions as an integral part of 
the site. If cookies are not turned on in the browser, my site will 
not work. I’ve been searching unsuccessfully to find the way to 
determine if the browser has cookies enabled.  I want to warn the 
user that the site won’t work if they have cookies turned off. There 
must be some global variable that tells me. Could someone help me out?

If the cookie you set is not send back, the cookies are turned off 
(unless you screwed up). You can redirect user to a "turn on your 
cookies" page at a point where cookies are really required and none is 
send.
and how would you know that? unless you specify an "alternative" string 
using GET ofcourse

By "where cookies are really required" I meant for example login page. 
If you find out that session cookie is not set while handling login 
form, you know that cookies are off.

The alternative you are talking about is also possible, but you have to 
be carefull so that these pages are not indexed by search engines.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] How to ensure cookies are turned on.

2004-11-29 Thread Thomas S. Crum - AAA Web Solution, Inc.
There is no global variable.

Set a cookie the when they hit the login page and then check to be sure that
cookie isset when they post to it.

Example for login.php:






Best,

Thomas S. Crum


-Original Message-
From: Marek Kilimajer [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 29, 2004 6:40 PM
To: M. Sokolewicz
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] How to ensure cookies are turned on.

M. Sokolewicz wrote:
> Marek Kilimajer wrote:
> 
>> Gary Reimer wrote:
>>
>>> Hello;
>>>
>>> I'm working on a website that uses sessions as an integral part of 
>>> the site. If cookies are not turned on in the browser, my site will 
>>> not work. I've been searching unsuccessfully to find the way to 
>>> determine if the browser has cookies enabled.  I want to warn the 
>>> user that the site won't work if they have cookies turned off. There 
>>> must be some global variable that tells me. Could someone help me out?
>>
>>
>>
>> If the cookie you set is not send back, the cookies are turned off 
>> (unless you screwed up). You can redirect user to a "turn on your 
>> cookies" page at a point where cookies are really required and none is 
>> send.
> 
> and how would you know that? unless you specify an "alternative" string 
> using GET ofcourse
> 

By "where cookies are really required" I meant for example login page. 
If you find out that session cookie is not set while handling login 
form, you know that cookies are off.

The alternative you are talking about is also possible, but you have to 
be carefull so that these pages are not indexed by search engines.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] How to ensure cookies are turned on.

2004-11-29 Thread M. Sokolewicz
Marek Kilimajer wrote:
Gary Reimer wrote:
Hello;
I’m working on a website that uses sessions as an integral part of the 
site. If cookies are not turned on in the browser, my site will not 
work. I’ve been searching unsuccessfully to find the way to determine 
if the browser has cookies enabled.  I want to warn the user that the 
site won’t work if they have cookies turned off. There must be some 
global variable that tells me. Could someone help me out?

If the cookie you set is not send back, the cookies are turned off 
(unless you screwed up). You can redirect user to a "turn on your 
cookies" page at a point where cookies are really required and none is 
send.
and how would you know that? unless you specify an "alternative" string 
using GET ofcourse

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How to ensure cookies are turned on.

2004-11-29 Thread Marek Kilimajer
Gary Reimer wrote:
Hello;
I’m working on a website that uses sessions as an integral part of the 
site. If cookies are not turned on in the browser, my site will not 
work. I’ve been searching unsuccessfully to find the way to determine if 
the browser has cookies enabled.  I want to warn the user that the site 
won’t work if they have cookies turned off. There must be some global 
variable that tells me. Could someone help me out?
If the cookie you set is not send back, the cookies are turned off 
(unless you screwed up). You can redirect user to a "turn on your 
cookies" page at a point where cookies are really required and none is send.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php