diff options
Diffstat (limited to 'lib/private/Session/Internal.php')
-rw-r--r-- | lib/private/Session/Internal.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/private/Session/Internal.php b/lib/private/Session/Internal.php index 4fadb1ac801..a24aec55222 100644 --- a/lib/private/Session/Internal.php +++ b/lib/private/Session/Internal.php @@ -26,6 +26,8 @@ namespace OC\Session; +use OCP\Session\Exceptions\SessionNotAvailableException; + /** * Class Internal * @@ -115,10 +117,15 @@ class Internal extends Session { * Wrapper around session_id * * @return string + * @throws SessionNotAvailableException * @since 9.1.0 */ public function getId() { - return @session_id(); + $id = @session_id(); + if ($id === '') { + throw new SessionNotAvailableException(); + } + return $id; } /** |