Friday , March 22 2019
Home / PHP / How can start session in php ?

How can start session in php ?

A session in php is started using session_start() function.
Globle variables (eg. $_SESSION.) are used for session variables.
Now we create a page “example_session.php” and start a session with some session variables :


// Start the session
<!DOCTYPE html>

// Set session variables
$_SESSION[“country”] = “India”;
$_SESSION[“animal”] = “cat”;
echo “Session variables are set.”;


About admin

Check Also

Resize Images in php

Creating thumbnails of the images is required many a times, this code will be useful ...

Leave a Reply