This is sometimes a confusing issue for people, but remember that 
cookies work like this:

1) client requests a resource from a Web server
2) Web server returns a response to the client including a request to 
set cookies ("Set-Cookie" header)
3) client requests another page from the Web server and includes the 
cookies ("Cookie" header) in the request

Some people want to know how they can tell whether the client accepts 
cookies after step 1 (during the processing that results in step 2). 
This is simply impossible.

However, you can adequately tell whether someone has cookies enabled 
after you receive a second HTTP request from that person. On this 
"second" page, simply test to see whether the cookie that you previously 
set exists (isset is a good function for this). If it doesn't exist, the 
client does not accept cookies. Some developers want this "check" to 
appear as if it were performed on a single transaction and force the 
client to make the second request.


Paul O'Neil wrote:

>If a browser has cookies blocked , anyone have code if unable to set cookie
>then  goto another page.

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to