Re: Re: session cookies enabled?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 9, 2007 10:36 am, ccspencer@xxxxxxxxxxxx wrote:
> This brings up a question.  In order to decide whether to use cookies
> or SID the built-in sessions must be testing to see if the user's
> browser will accept the session cookies.  How do they do that?

The same way you would do it.

Actually, they might have just used:

$cookie_name = session_name();
if (isset($_COOKIE[$cookie_name])){
  $session_id = $_COOKIE[$cookie_name];
}
elseif (isset($_REQUEST[$cookie_name])){
  $session_id = $_REQUEST[$cookie_name];
}
else{
  $session_id = uniquid();
}

> If they do it by the "2 page", send a cookie and see if it comes
> back to the second page method we have been talking about, then
> somehow, they are sureptiously inserting a forward to a non-
> existant page!  Right?  How do they do that?


No, that's not how it works.

JUST send the dang cookie on every page.

And check if it's there on every page.

And whatever first page the user gets to, with no cookie, be sure you
send them suitable content for having no cookie.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux