How to create a login sessions with php
Fermé
winatte
-
1 juil. 2013 à 20:01
JooS Messages postés 2468 Date d'inscription mardi 22 janvier 2008 Statut Membre Dernière intervention 8 juin 2016 - 2 juil. 2013 à 18:20
JooS Messages postés 2468 Date d'inscription mardi 22 janvier 2008 Statut Membre Dernière intervention 8 juin 2016 - 2 juil. 2013 à 18:20
A voir également:
- How to create a login sessions with php
- How to change qwerty to azerty - Guide
- Facebook.com/login/identify en francais - Forum Facebook
- Comment retrouver mon compte - Forum Facebook
- Wfp to mp4 - Forum Accessoires & objets connectés
- Welcome to nginx! ✓ - Forum Applis & Sites
1 réponse
JooS
Messages postés
2468
Date d'inscription
mardi 22 janvier 2008
Statut
Membre
Dernière intervention
8 juin 2016
228
2 juil. 2013 à 18:20
2 juil. 2013 à 18:20
Hi,
login sessions ?! do you mean login script ?
Sessions are just a global variables that have a larger lifetime than normal variables (5 -> 30min, depending on the server configuration), nothing directly related to MySQL.
So let say you have a form that contains two text fields (username and password), after submitting the form, you have to :
1 - Check the fields content, if it's correct (not empty ... etc) ...
2 - Make a SELECT SQL query including the fields content, to check if the username and password exist in the database, if they do and match ...
3 - Create a user session to prove that the user have (already) been connected, so that you can show/hide/allow/deny the current user to do some actions.
You can for example put in the session the user id and rank (that have been recovered from the last query).
login sessions ?! do you mean login script ?
Sessions are just a global variables that have a larger lifetime than normal variables (5 -> 30min, depending on the server configuration), nothing directly related to MySQL.
So let say you have a form that contains two text fields (username and password), after submitting the form, you have to :
1 - Check the fields content, if it's correct (not empty ... etc) ...
2 - Make a SELECT SQL query including the fields content, to check if the username and password exist in the database, if they do and match ...
3 - Create a user session to prove that the user have (already) been connected, so that you can show/hide/allow/deny the current user to do some actions.
You can for example put in the session the user id and rank (that have been recovered from the last query).