Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is meant by MIME?

1048


How to create an array of a group of items inside an html form?

1000


How to create connection in php?

1008


What does addslashes do in php?

1057


Define anonymous classes in php7?

1060


What is difference between compile time and run time polymorphism?

1019


What is a trait in php?

1019


In php how can you jump in to and out of "php mode"?

989


What does the arrow mean in php?

1020


What is the delimiter default in PHP?

1091


What is the ioncube php loader?

1030


Define object-oriented methodology?

1043


Why super () is used in java?

994


How to execute an sql query? How to fetch its result?

1129


How is session id stored in browser?

1016