Windows 7: Safari 5.1.2 PHP cookie issue

I am trying to set cookie using PHP on Safari higher version 5.1.2(7534.52.7) with Windows 7 OS but cookie is not getting set in this. This works for Window XP with same Safari version.

My simple code is:

setcookie($cookie_name, $cookievalue,time() +3600*24,"/","mydomain.com");

Any help?

Answers


Try setting all flags for setcookie:

setcookie($cookie_name, $cookievalue,time() +3600*24,"/","mydomain.com", false, true);

also be sure that nothing is being sent to the client before the cookie is set. That breaks cookie setting. E. g. some html or headers.


Need Your Help

attribute is not recorded in serialization arraylist

java serialization deserialization

When I do serialization with this code, I got a null pointer exception with 'managerL.get(1).getID()'. I am sure that it is serialized as an object as 'managerL.size()' return 1. When I try to open

Problems Accessing Video Files in Rails 3.2.6 Application

ruby-on-rails html5-video

I am writing a Rails 3.2.6 application where I want to show live streaming HTML5 videos along with on-demand videos at some point. I am using the Evolv software to create the live HTML5 video segm...