Use Of Session in PHP:
A session is a way to store information (in the form of variables) to be used across multiple pages. Unlike a cookie, specific variable information is not stored on the users computer. It is also unlike other variables in the sense that we are not passing them individually to each new page, but instead retrieving them from the session we open at beginning of each page.
USE OF session_start()
Session_start() is used in PHP to initiate a session on each PHP page. It must be the first thing sent to the browser, or it won't work properly,so it usually best place to use in php script at the top.
Example
<?php?>Use Of session variable($_SESSION)
A session variable is used to store information at server side and represented by $_SESSION.
Example
<?php?>Use Of session_unset()
Session_unset () is used to remove all variables in a session.
session_unset() is used to remove all session variables
session_unset() is used to remove all session variables
Example
<?php?>Use Of unset()
unset () is used to delete value of particular session variable.
Example
<?php?>Use Of session_destroy()
session_destroy() is used to destroy complete session environment.
Example
<?php?>
No comments:
Post a Comment