How can we know that a session is started or not?
Answer Posted / deep
we'll have to set a session variable after starting a
session as shown below
--------------------------------------------------
<?php
session_start();
if(isset($_SESSION['views']))
$_SESSION['views']=$_SESSION['views']+1;
else
$_SESSION['views']=1;
echo "Views=". $_SESSION['views'];
?>
--------------------------------------------------
it will set as well as increment the session variable
or we may simply echo a value to check whether a session is
started or not.
| Is This Answer Correct ? | 10 Yes | 0 No |
Post New Answer View All Answers
What is meant by MIME?
How to create an array of a group of items inside an html form?
How to create connection in php?
What does addslashes do in php?
Define anonymous classes in php7?
What is difference between compile time and run time polymorphism?
What is a trait in php?
In php how can you jump in to and out of "php mode"?
What does the arrow mean in php?
What is the delimiter default in PHP?
What is the ioncube php loader?
Define object-oriented methodology?
Why super () is used in java?
How to execute an sql query? How to fetch its result?
How is session id stored in browser?