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

Answers were Sorted based on User's Feedback



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

Answer / indrajeet

unset("userid" "timeout",60)

Is This Answer Correct ?    54 Yes 39 No

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

Answer / 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

More PHP Interview Questions

What does the unlink() function means?

0 Answers  


i have designed a registration form in html (registration.html) and to insert user details in database i have designed a submit form in php (submit_registration.php) but when i click on submit button in registration.html it opens a dialogue box which asks for open or save php(submit_registration.php) even though i have already installed apache HTTP server and php version 5 on my computer and i am using mysql as backend. plz suggest me what should i do????

3 Answers  


Is age an interval or ratio?

0 Answers  


List out different arguments in PHP header function?

4 Answers  


Explain the difference between require() and require_once()?

0 Answers  






I am writing an application in php that outputs a printable version of driving directions. It contains some long sentences, and I am a neat freak, and would like to make sure that no line exceeds 50 characters. How do I accomplish that with php?

0 Answers  


How to retrieve the original query string?

0 Answers  


Do while loops php?

0 Answers  


Where are the session values stored?

1 Answers  


can anyone explain oops concept in php or give website to learn this concept clearly?

2 Answers   Nadsoft, Satyam,


Suppose your Zend engine supports the mode <? ?> Then how can u configure your PHP Zend engine to support <?PHP ?> mode ?

1 Answers   Rushmore Consultancy,


How can I load data from a text file into a table?

0 Answers  


Categories