Thursday, January 28, 2016

PHP Sessions

What is a Session ??

A Session is a process of inter-related actions between  a  client  and a  web server. Session variables manages the memory of the browser when you exit a one page and go to another. 

How do we make the Browser remember a certain unit of data while we navigatefrom page to page?
 Simply, assign that data to a “session variable”, using thefollowing format - 
$_SESSION[“ << some unique name >> ”].

eg. :- $_SESSION[“employeeName”] = “Nimal”,

$_SESSION[“employeeID”] = EMP0589

• employeeName and employeeID are  uniquely identify a variable.

•Another method is, to use the predefined function session_register(“ “)

No comments:

Post a Comment