Cookie session expire


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  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. ?>

URL: www.mediapoint.gr

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.