Author Topic: setCookie not working in IE and Chrome but working in FireFox  (Read 10789 times)

PHPize

  • Newbie
  • *
  • Posts: 19
setCookie not working in IE and Chrome but working in FireFox
« on: October 30, 2011, 06:12:32 PM »
HI

I am going nuts . In an application I created a cookie using setcookie command, to my surprise cookies working good in firefox but in internet explorer and chrome it is not effective.

I checked cookie using options--> hunder the hood --> content , I don't see cookie but seeing some strange cookie named domain659 for my domain but I have never set that cookie but firefox it is working fine. ?

What is the issue ?
I am using following command
setcookie('counter',1,time()+600,'/');

Please help .. oho.. just to tell I am using php  ..

Jaffery

  • Administrator
  • Full Member
  • *****
  • Posts: 158
Re: setCookie not working in IE and Chrome but working in FireFox
« Reply #1 on: October 31, 2011, 06:15:27 AM »
600 seconds means 10 mins. Try to increase this because generally this happens if server time and local time mismatch or simple words, the server time is not correct.  Sometimes it happens due to difference in server time and your computer's local time.
For example, if difference between your computer and server computer is more than 10 minutes, then cookie will not set properly in IE yet it will work on Firefox. So try to set cookie as follows:
Code: [Select]
setcookie('counter',1,time()+3600,'/');

 

X

Do you know?

IfandBut.com helps you to keep yourself updated with latest internet business trends.
Join Now!