Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if($_SESSION['name']=="")
- header("Location: index.php");
- else{
- $cookie_name = "userID";
- $cookie_value = $_SESSION['name'];
- setcookie($cookie_name, $cookie_value, time() + (86400 * 30), "/"); // 86400 = 1 giorno
- }
- if(isset($_COOKIE['userID'])){
- $_SESSION['name']=$_COOKIE['userID'];
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement