Using Sessions to Store Data Across Pages in PHP


Start a session and store data to be accessed across different pages.

Source Code

session_start();
$_SESSION['user'] = 'JohnDoe';
echo "Session started and user set.";
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments