how to set session expire(session timeout) using php code

Answer Posted / er

$sessdir = ini_get('session.save_path');
if (!is_dir($sessdir)) { mkdir($sessdir, 0777); }
ini_set('session.save_path', $sessdir);
ini_set('session.gc_maxlifetime', 1);

Is This Answer Correct ?    34 Yes 23 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between for and foreach in php?

495


How to assigning a new character in a string?

574


Tell me how can we automatically escape incoming data?

504


Which function gives us the number of affected entries by a query?

515


What are the methods to submit form in php?

525






What exactly is validating and sanitizing?

617


When should you use a stored procedure?

500


Why php is widely used?

544


Tell me what type of operation is needed when passing values through a form or an url?

532


Differentiate between require and include?

537


How to list all values of submitted fields?

547


Is php front end or back end?

509


How to redirect a page in php?

574


Is php session id unique?

531


What is list function with their uses.

529