0

To make a session life go up to 10 minutes, is the below code correct because cannot tell:

ini_set('session.gc_maxlifetime',600);

OR

ini_set('session.gc_maxlifetime',1*10*60);  

1 Answers1

0

They are both correct, but the first one will run faster ( by a nanosecond )

Zoltan Toth
  • 46,981
  • 12
  • 120
  • 134
  • How come when I do it the first way that after 10 minutes that the session does not expire? – user1681039 Sep 26 '12 at 18:39
  • weird, that function takes the parameter in seconds ( [reference](http://php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime) ) and it should not matter if you're using the final number or do some math before – Zoltan Toth Sep 26 '12 at 18:48