Registering Variables with a Session : Session Variables « Cookie Session « PHP

Registering Variables with a Session

<title>Registering Variables with a Session</title>
$_SESSION['product1'] = "A";
$_SESSION['product2'] = "B";
print "The products have been registered";

Related examples in the same category

1.A session variable can be destroyed with a call to session_unregister().
2.Accessing Session Variables
3.Adding Session Data
4.Checking Session Data
5.Reading Session Data
6.Registering an Array Variable with a Session
7.Storing Complex Data Types in Sessions
8.Storing Complex Data Types to session
9.Storing Simple Data Types in Sessions