Skip to content

Commit 0d0d9a0

Browse files
committed
Removed \Exception and use a JwtSessionException
1 parent f1d5536 commit 0d0d9a0

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/JwtSession.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct($serverName, $secretKey, $timeOutMinutes = null, $se
3838
public function replaceSessionHandler($startSession = true)
3939
{
4040
if (session_status() != PHP_SESSION_NONE) {
41-
throw new \Exception('Session already started!');
41+
throw new JwtSessionException('Session already started!');
4242
}
4343

4444
session_set_save_handler($this, true);
@@ -197,7 +197,7 @@ public function unSerializeSessionData($session_data)
197197
$offset = 0;
198198
while ($offset < strlen($session_data)) {
199199
if (!strstr(substr($session_data, $offset), "|")) {
200-
throw new \Exception("invalid data, remaining: " . substr($session_data, $offset));
200+
throw new JwtSessionException("invalid data, remaining: " . substr($session_data, $offset));
201201
}
202202
$pos = strpos($session_data, "|", $offset);
203203
$num = $pos - $offset;

src/JwtSessionException.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
namespace ByJG\Session;
3+
4+
class JwtSessionException extends \Exception
5+
{
6+
7+
}

0 commit comments

Comments
 (0)