October 3rd, 2013, 09:37 AM
Cookies are not working on my live server
I have put a project on my live server (Ubuntu Server 12.0.4 LTS) which is located at my home in Jordan (Middle East), but unfortunately the cookies are not working on IE, Opera and Safari. But it works partially on Chrome and FF.
I have placed my code on a server in US and it worked fine.
Also, it works fine on my WAMP server at Windows 7 Machine.
To set cookies, I use: setcookie("test", time(), time()+3600). I tried also setcookie("test", time(), time()+3600, '/'), but with no luck too
Also, the domain has no dashes, it is like: www.mydomain.com
It seems a problem in server configuration, I compared between phpinfo() in WAMP and My live server in Jordan but didn't find much differences.
Would you please hint me? Any server configuration should be changed to accept saving cookies at clients machines?
Thank you very much!
October 3rd, 2013, 09:50 AM
It may be a problem with the server time. If your server sends me a cookie with an expiration date of last week, my browser will discard it immediately. Check the actual output of time() and see how it compares to your local computer. One or both of the clocks may be wrong.
HEY! YOU! Read the New User Guide and Forum Rules
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002
Think we're being rude? Maybe you asked a bad question
or you're a Help Vampire.
Trying to argue intelligently? Please read this.
October 4th, 2013, 04:07 PM
Thanks for your response. In Jordan the time will be different so will my server send you in US(for example) late cookies? I didn't get notification on email for this thread and updated the server time and worked out! Thank you!
Originally Posted by ManiacDan