How can we know that a session is started or not?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / rahul
on head of the page we have to write
session_start();
statement.
| Is This Answer Correct ? | 3 Yes | 9 No |
Answer / kamlesh
we can check is_session_start() by this function.
| Is This Answer Correct ? | 3 Yes | 9 No |
What is a php session?
What is the difference between myisam and innodb?
Do you know what is the difference between mysql_fetch_object() and mysql_fetch_array()?
Explain me difference between mysql_connect and mysql_pconnect?
What is .htaccessfile and use of this file
What is PHP?
What version of php do I have windows?
What is $_session in php?
WWhat is the functionality of md5 function in PHP?
What is the difference between php traits vs interfaces?
What is session and Cokkies . How it works . tell some thing about Session_id()
1 Answers DVS, Net Solution, PVWEBCO,
How long is a php session valid?