dhimok Posted June 26, 2007 Share Posted June 26, 2007 Hello everyone. I have this question Is it possible to control cookies from my own domain stored on users computers? I wonder if I can change the expiry date, increase or decrease or delete them, while they are already set from before Thanks Quote Link to comment Share on other sites More sharing options...
aim25 Posted June 26, 2007 Share Posted June 26, 2007 Yes you can, very easily too. Quote Link to comment Share on other sites More sharing options...
dhimok Posted June 26, 2007 Author Share Posted June 26, 2007 I would like to add some more details: Lets say I store a cookie when a user enters my page that will expire in 1 year. Next time the same user enters the page it wont set the cookie again, unless its not there. Now I want that cookie which is stored to expire in 3 days. Is this possible and if yes then how Quote Link to comment Share on other sites More sharing options...
corillo181 Posted June 26, 2007 Share Posted June 26, 2007 i think before you learn to modify something you should learn how to make it. http://www.tutorialized.com/tutorials/PHP/Cookies-and-Sessions/1 Quote Link to comment Share on other sites More sharing options...
dhimok Posted June 26, 2007 Author Share Posted June 26, 2007 This is what I did. I think its ok if(!isset($_COOKIE["uid"])) { $uid = sha1(session_id().@time()); $expire1 = 365*24*3600; // 1 year setcookie("uid", $uid, (time() + $expire)); } else { $expire2 = 7*24*3600; // 1 week; setcookie("uid", $_COOKIE["uid"], (time() + $expire2)); } Any other ideas would be appriciated Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.