IE can't get cookies

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
valen53
Forum Contributor
Posts: 137
Joined: Tue Aug 27, 2002 9:29 am

IE can't get cookies

Post by valen53 »

i face a problem, i running my system in local intranet. i have set the cookies to my system. Unfortunelly some of the pc cannot accept cookies no matter how i changing the internet setting.

It was not related to the IE version. b'cos i can run system in IE5 IE5.5 , IE6 also. i dunno where is occur error. b'cos i set the same setting to all of the PC.


anyone can give a comment ??? thank a lot.
User avatar
cactus
Forum Regular
Posts: 343
Joined: Tue Jun 10, 2003 4:16 am
Location: UK

Post by cactus »

Can you post the code for writing your cookies, may help us debug/understand what you are trying to achieve.

Regards,
User avatar
delorian
Forum Contributor
Posts: 223
Joined: Sun May 04, 2003 5:20 pm
Location: Olsztyn, Poland

Post by delorian »

Yes, I have got the same problems with cookies on WXP systems. No matter how insecure my settings are, from some sites I just don't get cookies. I think it's probably the M$ fault. But of course I can be wrong.

As for my tip I recommend using sessions instead of cookies. But you can also add your intranet sites to you Trusted Sites Sphere (I don't know if that's the way it's called in english Win version :)) - then the cookies should be accepted
valen53
Forum Contributor
Posts: 137
Joined: Tue Aug 27, 2002 9:29 am

Post by valen53 »

i just use a very simple set cookies function when user login system.

setcookie("ecm",$username,time()+3600);

if(!isset($ecm)) -> go to login page. else to index page
User avatar
cactus
Forum Regular
Posts: 343
Joined: Tue Jun 10, 2003 4:16 am
Location: UK

Post by cactus »

Supply the setcookie() method with ALL the paramters as per:

http://uk.php.net/setcookie

You can skip the last parameter (int secure), if your not using HTTPS (or don't intend using the secure option):
PHP Man wrote:Indicates that the cookie should only be transmitted over a secure HTTPS connection. When set to 1, the cookie will only be set if a secure connection exists. The default is 0.
Regards,
Post Reply