Jump to content

Cannot set cookies in Firefox, only in IE


JCS1988

Recommended Posts

Thanks for the reply. I tried that but I get a syntax error.

 

Parse error: syntax error, unexpected ',' in /whs2fs1_2us4_2/jcs5325aii/domains/jcs5325.aisites.com/public_html/member-index.php on line 6

 

The modified code:

<?php	
session_start();
require_once('auth.php');
$customer_id = $_SESSION['SESS_CUSTOMER_ID'];

setcookie("currentcustomer", $customer_id, time()+3600*24), '/', 'www.jcs5325.aisites.com';

?>

 

Removing the ")" gives me an error.

 

Parse error: syntax error, unexpected ';' in /whs2fs1_2us4_2/jcs5325aii/domains/jcs5325.aisites.com/public_html/member-index.php on line 6

 

This is what I have

<?php	
session_start();
require_once('auth.php');
$customer_id = $_SESSION['SESS_CUSTOMER_ID'];

setcookie("currentcustomer", $customer_id, time()+3600*24, '/', 'www.jcs5325.aisites.com';
?>

 

 

I didn't say remove it, I said it's causing the problem...

 

setcookie("currentcustomer", $customer_id, time()+3600*24, '/', 'www.jcs5325.aisites.com';

 

That's with it removed, do you see anything wrong? Maybe a mising ")" before the semi-colon?

 

The error even tells you the problem... unexpected ';'... that means there's something missing before the semi-colon. Geez. :D

That's with it removed, do you see anything wrong? Maybe a mising ")" before the semi-colon?

 

The error even tells you the problem... unexpected ';'... that means there's something missing before the semi-colon. Geez. :D

 

It's staring you in the face...

I just found this on PHP.net:

 

If output exists prior to calling this function, setcookie() will fail and return FALSE. If setcookie() successfully runs, it will return TRUE. This does not indicate whether the user accepted the cookie.

 

That's interesting to note... also it isn't deprecated.

Thanks for checking that. Feeling a bit too lazy today to check it myself.

 

setcookie for settings cookies

$_COOKIE for retrieving cookies.

 

 

Good pickup on the setcookie returning false if output has occured already. One to keep an eye out for now... :o

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.