diff options
author | Christoph Wurst <christoph@owncloud.com> | 2016-04-25 10:23:06 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@owncloud.com> | 2016-04-25 10:36:24 +0200 |
commit | 0d53e86421faef0300d509b385934754b4dab88c (patch) | |
tree | f5319c156015c720115941cc4b3e79d3cfa7b9f7 /lib/private/Session | |
parent | 74de72e75e68cb3aaffa2ab90fbd685e755b4262 (diff) | |
download | nextcloud-server-0d53e86421faef0300d509b385934754b4dab88c.tar.gz nextcloud-server-0d53e86421faef0300d509b385934754b4dab88c.zip |
add ISession::getId() wrapper for session_id
Diffstat (limited to 'lib/private/Session')
-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() { |