Jump to content


Photo

plz debug this


  • Please log in to reply
2 replies to this topic

#1 werty37

werty37
  • Members
  • PipPipPip
  • Advanced Member
  • 49 posts

Posted 31 May 2006 - 10:54 AM

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



<?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'];
}
?>


Thanks



#2 KrisNz

KrisNz
  • Members
  • PipPipPip
  • Advanced Member
  • 271 posts
  • LocationAuckland, New Zealand

Posted 31 May 2006 - 11:03 AM

You aren't actually setting any cookies. add
setcookie("RESULTS") = 'whatever';
and you'll be sorted.

#3 werty37

werty37
  • Members
  • PipPipPip
  • Advanced Member
  • 49 posts

Posted 31 May 2006 - 11:16 AM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users