Php Sessions are used to store data inside variable in server. Generally cookies are stored in local system that is in our computer but sessions will be stored in the server.
PHP SESSION SYNTAX:
$_SESSION["session_name"] = "data";PHP SESSION EXAMPLE:
$_SESSION["username"] = "eshinjozer";
When we create session as like above given example, in the session variable "username", the data "eshinjozer" will be stored on server.
PHP SESSION CREATION PROGRAM:
OUTPUT:
If the session was created, then the output will be "Session created successfully" else "Session was not created"
No comments:
Post a Comment