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

Answer Posted / archana

ini_set('session.gc_maxlifetime', 14400);
ini_set('session.gc_probability', 1);
ini_set('session.gc_divisor', 100);

add above codes in index.php. it will work.

changing php.ini value is not a good way.it will not work.

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is overloading in php?

546


How does php session work?

518


How can we access the data sent through the url with the post method?

503


Write a program to display table of a number using php?

492


Who created numbers?

519






Can the value of a constant change during the script's execution?

542


What does echo mean in php?

552


Tell me how to find current date and time?

538


What is $_ get in php?

602


What is scope of variable in php?

570


What are the differences between require and include?

565


What does odbc do in context with php?

565


am from coimbatore.am learning php&mysql. what will be the approx salary for me if i get a job in coimbatore.

1548


What is the best practice for running mysql queries in php? Consider the risk of sql injection.

546


How is it possible to remove escape characters from a string?

568