Skip to content

Commit 5bd5cd4

Browse files
committed
Add clean method
1 parent e8af0e6 commit 5bd5cd4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Session/Session.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,17 @@ public static function changeSessionLifetime(int $newLifetime)
146146
$_SESSION = $tempSession;
147147
}
148148

149+
/**
150+
* Clean session data
151+
*
152+
* @return void
153+
*/
154+
public static function clean(): void
155+
{
156+
self::start();
157+
foreach ($_SESSION as $key => $value) unset($_SESSION[$key]);
158+
}
159+
149160
/**
150161
* Destroy a session
151162
*

0 commit comments

Comments
 (0)