Created
September 7, 2013 10:05
-
-
Save laminr/6474376 to your computer and use it in GitHub Desktop.
PHP Session usage
This file contains hidden or 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 | |
| // On démarre la session | |
| // (ceci est indispensable dans TOUTES les pages de notre section membre, mais une seul fois pas page -si on fait des includes....) | |
| // TOUJOURS AU TOUT DEBUT DE LA PAGE | |
| session_start (); | |
| // pour une page de connection | |
| $_SESSION['login'] = $_POST['login']; | |
| $_SESSION['pwd'] = $_POST['pwd']; | |
| ?> | |
| <?php | |
| // PAGE DE LOGOUT ////// | |
| // On démarre la session | |
| session_start (); | |
| // On détruit les variables de notre session | |
| session_unset (); | |
| // On détruit notre session | |
| session_destroy (); | |
| // On redirige le visiteur vers la page d'accueil | |
| header ('location: index.htm'); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment