Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. <?php
  2. $id_usuario = $_SESSION['user_id'];
  3. $usuario = $_SESSION['user_name'];
  4.  
  5. setcookie($usuario, $id_usuario, time() + (86400 * 30), "/");
  6.  
  7. if(!isset($_COOKIE[$usuario])) {
  8. echo "Cookie named '" . $usuario . "' is not set!";
  9. } else {
  10. echo "Cookie '" . $usuario . "' is set!<br>";
  11. echo "Value is: " . $_COOKIE[$usuario];
  12. }
  13. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement