Php Session Code Example - Php

How to use session code in PHP?

Snippet Code

Rate this page :
  [ 0 votes]

Session variables store the information to be used across multiple pages. Here, session_start() function is used to start the session and $_SESSION variable is used to create a session.

<?php // Start the session session_start(); // Set session variables $_SESSION["admin"] = "hiox"; $_SESSION["login"] = "hscripts"; echo "Session variables are set."; echo "</br>"; print_r($_SESSION); ?>


Ask Questions

Ask Question