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

If we login more than one browser windows at the same time with same user and after that we close one window, then is the session is exist to other windows or not? And if yes then why? If no then why?

964


What is the role of php.ini file?

995


What is scope of variable in php?

1055


What is difference between include and include_once in php?

944


How to protect special characters in query string?

966


What is the use of anonymous function in php?

978


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

983


Is php harder than javascript?

1017


Explain difference between urlencode and urldecode?

1125


What is laravel php?

1023


What is use of header() function in php?

1029


Why post method is used in php?

1109


Tell me what are the functions to be used to get the image's properties (size, width and height)?

1041


How a variable is declared in php?

960


What is htaccess in php?

1283