Skip to content

Commit c04545f

Browse files
committed
Added ability to set lifetime during the init.
1 parent feca178 commit c04545f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Session.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,14 @@ public static function getPrefix()
5757
/**
5858
* If session has not started, start sessions.
5959
*
60+
* @param int $LifeTime → Lifetime of session in seconds
61+
*
6062
* @return bool
6163
*/
62-
public static function init()
64+
public static function init($LifeTime = 0)
6365
{
6466
if (self::$sessionStarted == false) {
65-
session_set_cookie_params(0);
67+
session_set_cookie_params($LifeTime);
6668
session_start();
6769

6870
return self::$sessionStarted = true;

0 commit comments

Comments
 (0)