Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. <?php
  2.  
  3. session_start();
  4. session_destroy();
  5.  
  6. header('location:Login.php');
  7.  
  8.  
  9. $cookie_user = $_SESSION['username'];
  10. $cookie_password = $_SESSION['password'];
  11.  
  12. $domain = ($_SERVER['HTTP_HOST'] != 'localhost') ? $_SERVER['HTTP_HOST'] : false;
  13.  
  14. setcookie($cookie_user, $cookie_password, time() + (86400 * 30),"/", $domain);
  15.  
  16.  
  17.  
  18.  
  19. if(!isset($_COOKIE[$cookie_user])){
  20. echo "Cookie Username '" . $cookie_user . "' is not set!";
  21. }
  22. else{
  23. echo "Cookie Username '" . $cookie_user. "' is set!";
  24. }
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement