Jump to content

Archived

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

werty37

plz debug this

Recommended Posts

Hi
This script always throws the message "Cookies are disabled".


[code]

<?php ob_start('ob_gzhandler');

if (!isset($_COOKIE['RESULTS']))
{
session_name('RESULTS);
session_set_cookie_params(3600, "/results", "", 0);
session_start();
ob_flush();
if (!isset($_COOKIE['RESULTS'])) {echo "Cookies are disabled";}
}
else
{
echo $COOKIE['RESULTS'];
}
?>

[/code]

Thanks

Share this post


Link to post
Share on other sites
You aren't actually setting any cookies. add [code]setcookie("RESULTS") = 'whatever';[/code] and you'll be sorted.

Share this post


Link to post
Share on other sites
HI

Actually, I am modifying the php sessin id name.
I ve changed the name from PHPSESSID to RESULTS
So the cookie RESULTS would contain the session id
generated by php. I dont wanna change the value of the
cookie. Moreover When i check the cookie RESULTS,
it contains the the session_id. So it is already set, right

Thanks

Share this post


Link to post
Share on other sites

×

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.