X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fsession%2FSessionManagerInterface.php;h=3ab0f431835e862441ead728c3f09f9a6bdcc664;hb=e968a1f431ad058dcb14adb2757bde5664b99a79;hp=b3e28fe1275fe6b6ac9e8739a419a6edad468c64;hpb=7f91193ef37d534949950c980416b5a921cd5d79;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/session/SessionManagerInterface.php b/includes/session/SessionManagerInterface.php index b3e28fe127..3ab0f43183 100644 --- a/includes/session/SessionManagerInterface.php +++ b/includes/session/SessionManagerInterface.php @@ -24,6 +24,7 @@ namespace MediaWiki\Session; use Psr\Log\LoggerAwareInterface; +use User; use WebRequest; /** @@ -35,7 +36,8 @@ use WebRequest; */ interface SessionManagerInterface extends LoggerAwareInterface { /** - * Fetch the session for a request + * Fetch the session for a request (or a new empty session if none is + * attached to it) * * @note You probably want to use $request->getSession() instead. It's more * efficient and doesn't break FauxRequests or sessions that were changed @@ -51,6 +53,7 @@ interface SessionManagerInterface extends LoggerAwareInterface { /** * Fetch a session by ID + * * @param string $id * @param bool $create If no session exists for $id, try to create a new one. * May still return null if a session for $id exists but cannot be loaded. @@ -61,7 +64,7 @@ interface SessionManagerInterface extends LoggerAwareInterface { public function getSessionById( $id, $create = false, WebRequest $request = null ); /** - * Fetch a new, empty session + * Create a new, empty session * * The first provider configured that is able to provide an empty session * will be used. @@ -72,6 +75,17 @@ interface SessionManagerInterface extends LoggerAwareInterface { */ 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. *