top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

How to create our own session in php?

0 votes

Give some sample code for creating session in php.Also,provide some sample link for learning about session in php.

posted Sep 29, 2014 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

For creating session first you need to start the session by using below code


Then using $_SESSION we can create a session variable.

Example Code:

<?php session_start(); // store session data $_SESSION['views']=1; ?>


//retrieve session data
echo "Pageviews=". $_SESSION['views'];


More Reference visit ->

answer Sep 30, 2014 by Sandeep Bedi
Similar Questions
Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.