Add SessionManager::invalidateSessionsForUser
[lhc/web/wiklou.git] / includes / session / SessionManagerInterface.php
index d58d3b9..d4e52c7 100644 (file)
@@ -24,6 +24,7 @@
 namespace MediaWiki\Session;
 
 use Psr\Log\LoggerAwareInterface;
 namespace MediaWiki\Session;
 
 use Psr\Log\LoggerAwareInterface;
+use User;
 use WebRequest;
 
 /**
 use WebRequest;
 
 /**
@@ -34,21 +35,6 @@ use WebRequest;
  * @since 1.27
  */
 interface SessionManagerInterface extends LoggerAwareInterface {
  * @since 1.27
  */
 interface SessionManagerInterface extends LoggerAwareInterface {
-       /**
-        * Fetch the persisted session ID in a request.
-        *
-        * Note this is not the same thing as whether the session associated with
-        * the request is currently persistent, as the session might have been
-        * first made persistent during this request.
-        *
-        * @param WebRequest $request
-        * @return string|null
-        * @throws \\OverflowException if there are multiple sessions tied for top
-        *  priority in the request. Exception has a property "sessionInfos"
-        *  holding the SessionInfo objects for the sessions involved.
-        */
-       public function getPersistedSessionId( WebRequest $request );
-
        /**
         * Fetch the session for a request
         *
        /**
         * Fetch the session for a request
         *
@@ -58,7 +44,7 @@ interface SessionManagerInterface extends LoggerAwareInterface {
         * @param WebRequest $request Any existing associated session will be reset
         *  to the session corresponding to the data in the request itself.
         * @return Session
         * @param WebRequest $request Any existing associated session will be reset
         *  to the session corresponding to the data in the request itself.
         * @return Session
-        * @throws \\OverflowException if there are multiple sessions tied for top
+        * @throws \OverflowException if there are multiple sessions tied for top
         *  priority in the request. Exception has a property "sessionInfos"
         *  holding the SessionInfo objects for the sessions involved.
         */
         *  priority in the request. Exception has a property "sessionInfos"
         *  holding the SessionInfo objects for the sessions involved.
         */
@@ -87,6 +73,17 @@ interface SessionManagerInterface extends LoggerAwareInterface {
         */
        public function getEmptySession( WebRequest $request = null );
 
         */
        public function getEmptySession( WebRequest $request = null );
 
+       /**
+        * Invalidate sessions for a user
+        *
+        * After calling this, existing sessions should be invalid. For mutable
+        * session providers, this generally means the user has to log in again;
+        * for immutable providers, it generally means the loss of session data.
+        *
+        * @param User $user
+        */
+       public function invalidateSessionsForUser( User $user );
+
        /**
         * Return the HTTP headers that need varying on.
         *
        /**
         * Return the HTTP headers that need varying on.
         *