Jump to content

session cookie


werty37

Recommended Posts

Hi

[code]
<?php ob_start('ob_gzhandler');

if (!isset($_COOKIE['PHPSESSID']))
{
session_start();
ob_flush();
if (!isset($_COOKIE['PHPSESSID'])) { echo "Cookies are disabled."; }
else { echo session_id(); }
}

ob_flush();
?>
[/code]

ok, i want to know how i can access my phpcookie, since all the people who use php with sessions
have a PHPSESSID.
lets say for example- your site uses php -session enabled, and my site uses the same, if a visitor
vists your site and my site at the same time, how can i access only my PHPSESSID cookie and not yours.

Hope i am making it clear...

Thanks in advance
Link to comment
https://forums.phpfreaks.com/topic/10788-session-cookie/
Share on other sites

HI
So i have a problem with this code. it always prints "Cookies are disabled."
on first request even though i flush the buffer to the client.
Secondly, when i check the cookie details in the browser,
i can see that session_set_cookie_params() did not work.
What is wrong?

[code]
<?php ob_start('ob_gzhandler'); session_start();

if (!isset($_COOKIE['PHPSESSID']))
{
session_set_cookie_params("3600","/test","localhost","0");
session_start();
ob_flush();
if (!isset($_COOKIE['PHPSESSID'])) { echo "Cookies are disabled."; }
}
else { echo session_id(); }
//ob_flush();
?>
[/code]

Thanks in advance
werty37
Link to comment
https://forums.phpfreaks.com/topic/10788-session-cookie/#findComment-40346
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.