diff options
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Session/CryptoSessionData.php | 10 | ||||
-rw-r--r-- | lib/private/Session/Internal.php | 10 | ||||
-rw-r--r-- | lib/private/Session/Memory.php | 10 |
3 files changed, 30 insertions, 0 deletions
diff --git a/lib/private/Session/CryptoSessionData.php b/lib/private/Session/CryptoSessionData.php index f6c585c1611..23731ef4560 100644 --- a/lib/private/Session/CryptoSessionData.php +++ b/lib/private/Session/CryptoSessionData.php @@ -142,6 +142,16 @@ class CryptoSessionData implements \ArrayAccess, ISession { } /** + * Wrapper around session_id + * + * @return string + * @since 9.1.0 + */ + public function getId() { + return $this->session->getId(); + } + + /** * Close the session and release the lock, also writes all changed data in batch */ public function close() { diff --git a/lib/private/Session/Internal.php b/lib/private/Session/Internal.php index 09175bf1f2f..4fadb1ac801 100644 --- a/lib/private/Session/Internal.php +++ b/lib/private/Session/Internal.php @@ -112,6 +112,16 @@ class Internal extends Session { } /** + * Wrapper around session_id + * + * @return string + * @since 9.1.0 + */ + public function getId() { + return @session_id(); + } + + /** * @throws \Exception */ public function reopen() { diff --git a/lib/private/Session/Memory.php b/lib/private/Session/Memory.php index 777458a9aa5..3dba274f395 100644 --- a/lib/private/Session/Memory.php +++ b/lib/private/Session/Memory.php @@ -89,6 +89,16 @@ class Memory extends Session { public function regenerateId($deleteOldSession = true) {} /** + * Wrapper around session_id + * + * @return string + * @since 9.1.0 + */ + public function getId() { + throw new \Exception('Memory session does not have an ID'); + } + + /** * Helper function for PHPUnit execution - don't use in non-test code */ public function reopen() { |