namespace MediaWiki\Session;
use Psr\Log\LoggerAwareInterface;
+use User;
use WebRequest;
/**
* @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
*
* @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.
*/
*/
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.
*