Monday, April 23, 2007

Php Sessions

In Php we start session by using session_start(); and we destroy session by session_destroy().
The syntax for storing a value in session is
$_SESSION['variable']="value";

For example , to store username and password
$_SESSION["username"]="XXX";
$_SESSION["password"]="YYYY";

Be careful with this statement as it is case sensitive.Instead of using "$_SESSION" , if you use "$_session" , it is taken as another variable rather than session.

No comments: