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

How to get the number of characters in a string?

0 Answers  


What good is polymorphism?

0 Answers  


Explain me how to include a file to a php page?

0 Answers  


Which variable declarations within a class is invalid in php?

0 Answers  


i got this error msg in online... how to solve this problem... i couldnot find out as soon as possible send me answer or idea COULD NOT ABLE TO CONNECT DATABASE . Can't connect to local MySQL server through socket '/usr/local/mysql-5.0/data/mysql.sock' (2)

3 Answers   Quest,


please send me the interview questions and answers to my mail id : srikanthgovardana@yahoo.com or srikanthgovardana@gmail.com

0 Answers  


for image work which library?

0 Answers  


What are the three classes of errors that can occur in php?

0 Answers  


What is isset and unset in php?

0 Answers  


Is it more secure to use cookies to transfer session ids?

0 Answers  


Tell me which programming language does php resemble to?

0 Answers  


What the difference between the 'bitwise and' operator and the 'logical and' operator?

0 Answers  


Categories