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 |
Explain me what is the meaning of a persistent cookie?
What is difference between session_unset and session_destroy?
What is the difference between require and include in php?
How can I increase my website session?
i have a string and that string contains the alphanumeric value and i want to hide or semihide the 10 digit telephone number from the string.
What is inheritance in php with example?
how long a default session stay in php?
how to select single row from table and insert into same table as a new record by using a single sql query.
Explain me how to include a file to a php page?
What is php and what does it do?
Why session timeout is important?
How can I rotate an image?
1 Answers Rushmore Consultancy,