Created
July 20, 2018 17:27
-
-
Save erandirjunior/97f8b6ac90a1aa4651490846690a1080 to your computer and use it in GitHub Desktop.
Utilização de session
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
$id = !empty($_SESSION['id']) ? $_SESSION['id'] : null; | |
session_regenerate_id(true); | |
if (!empty($_SESSION['id'])) { | |
$_SESSION['id'] = $id; //utilizo para outras coisas | |
} | |
//alguma coisa | |
/*Verifica se existe uma session id, caso não exista redireciona o usuário*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment