Posted By

mediapoint on 03/16/11


Tagged

session cookie expire


Versions (?)

Cookie session expire


 / Published in: PHP
 

URL: www.mediapoint.gr

  1. <?php
  2. // don't cache this page:
  3. header("Cache-Control: no-cache, must-revalidate");
  4. header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
  5. // check for cookie, then set/refresh it:
  6. $asite = isset($_COOKIE['asite']);
  7. setcookie('asite', 1, time()+60*60, '/', '.mysite.com'); // note leading "." for domain
  8. // if cookie set, redirect:
  9. if($asite)
  10. {
  11. header("Location: http://www.mysite.com/page1/");
  12. exit;
  13. }
  14. // rest of intro page follows....
  15. ?>

Report this snippet  

You need to login to post a comment.