#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2010
    Posts
    95
    Rep Power
    0

    Post Cookies are not working on my live server


    Hello,

    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!
  2. #2
  3. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6352
    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.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2010
    Posts
    95
    Rep Power
    0
    Originally Posted by ManiacDan
    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.
    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!

IMN logo majestic logo threadwatch logo seochat tools logo