+ 13
What is session in PHP? How to remove data from a session?
6 ответов
+ 3
مثل کوکی عمل میکنه با این تفاوت که با بستن مرورگر اطلاعات Session پاک میشه
+ 3
- A session is a global variable stored on the server. Each session is assigned a unique id which is used to retrieve stored values. Whenever a session is created, a cookie containing the unique session id is stored on the user’s computer and returned with every request to the server. If the client browser does not support cookies, the unique php session id is displayed in the URL Sessions have the capacity to store relatively large data compared to cookies.
- Destroying Session Variables. The session_destroy() function is used to destroy the whole Php session variables. If you want to destroy only single item, you use the unset() function.
+ 1
session_destroy()
+ 1
Si no sólo te convence utilizar session_destroy() antes de eso reinicie la variable $_SESSION = array(); y listo, saludos.
+ 1
session is used to track the user from one page to another on a site, using the user information like username or email or surname but I prefer using email because it's unique,
Example
<?php
session_start() ;
$_SESSION["email"] = $_POST["User Email" ] ;//this stage you have collected email from the user and store it in a session so if the user navigate from one page to another the session tracks him except if the session is destroyed using session_destroy() ;
- 1
جملات شرطی چطوره درc#