What is the default session time in PHP and how can I
change it?

Answers were Sorted based on User's Feedback



What is the default session time in PHP and how can I change it?..

Answer / bharanikumar

@Ashutosh Kumar

create flag field in login table,
Write error counter, check when error counter greater than
3, then write update query and change the flag field value
to disable, while check the login check this filed, it
should not be disable value.

Is This Answer Correct ?    3 Yes 6 No

What is the default session time in PHP and how can I change it?..

Answer / kuldeep verma

it is true that by default time of session 140 sec. and we
can change in php.ini....
it is also depend on brower. when closing the brower then
session lost. session data will be deleted after session
timeout.if connection lost. And recreate the connection then
it session continue.......

Is This Answer Correct ?    17 Yes 28 No

What is the default session time in PHP and how can I change it?..

Answer / rakesh kumar nautiyal

<?php
session_start();

session_cache_expire(15);
$cache_expire = session_cache_expire();

if(!isset($_SESSION['password'])){
$msg = "Your session is expired.Please re enter the
password";
header("Location: index.php?msg=".$msg);
} else {
// remaining code to display the gallery
}
?>

Is This Answer Correct ?    44 Yes 63 No

Post New Answer

More PHP Interview Questions

Hello Friends,I am seeking for a job in php having 2yrs. exp.Please suggest any company openings.

1 Answers  


What is the default session time in php?

0 Answers  


How can we extract string 'abc.com' from a string "http://info@abc.com" using regular expression of PHP

6 Answers   Wipro,


What are traits?

0 Answers  


Why php is sometimes called as embedded scripting language?

0 Answers  






What is difference Between PHP 5 and 7?

0 Answers  


Explain the value of the variable input is a string 1,2,3,4,5,6,7. How would you get the sum of the integers contained inside input?

0 Answers  


CWD is a type of shell variable. State Whether True or False?

0 Answers  


How many different types of messages available in php?

0 Answers  


How can I make a script that can be bilingual (supports english, german)?

0 Answers  


How To Get the Uploaded File Information in the Receiving Script?

0 Answers  


What is php and how do you use it?

0 Answers  


Categories