Still Logged In with cookie : _COOKIE « Cookie Session « PHP






Still Logged In with cookie

 
<?php
  $auth = $_COOKIE['auth'];

  header( "Cache-Control:no-cache" ); 

  if( ! $auth == "ok" ) 
  {
    header("Location:login.php" );
    exit();
  }
?>


<html>

 <head>
  <title>Still Logged In</title>
 </head>

 <body>
  You are still logged in ...
 </body>

</html>
  
  








Related examples in the same category

1.Checking for Cookie Support from PHP
2.Setting and Printing a Cookie Value
3.Get Cookie Data
4.Reading a cookie value
5.Printing a cookie value
6.Reading all cookie values