Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to make a cookie with no expire lifetime

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 215
    Comment on it

    Hello Reader's If you have writing the code that makes the cookies for valid lifetime then you just need to set big number for it's validity. As the example below PHP code:-

    1. Maximum value: 2147483647
    2.  
    3. setcookie("CookieName", "CookieValue", 2147483647);
    4. To avoid integer overflow the timestamp should be set to:
    5.  
    6. 2^31 - 1 = 2147483647 = 2038-01-19 04:14:07

    So now this cookie is valid for year 2038.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Reset Password
Fill out the form below and reset your password: