IUserSession

interface OCP\IUserSession
User session
Implemented by:OC\User\Session
Source:lib/public/IUserSession.php#42

Methods

public OCP\IUserSession::login($user, $password)
Do a user login
Source:

lib/public/IUserSession.php#50

Parameters:
  • $user (string) the username
  • $password (string) the password
Returns:

bool true if successful

Since:

6.0.0

public OCP\IUserSession::logout()
Logs the user out including all the session data
Logout, destroys session
Source:lib/public/IUserSession.php#58
Returns:void
Since:6.0.0
public OCP\IUserSession::setUser($user)
set the currently active user
Source:

lib/public/IUserSession.php#66

Parameters:
Since:

8.0.0

public OCP\IUserSession::getUser()
get the current active user
Source:lib/public/IUserSession.php#74
Returns:\OCP\IUser | null Current user, otherwise null
Since:8.0.0
public OCP\IUserSession::isLoggedIn()
Checks whether the user is logged in
Source:lib/public/IUserSession.php#82
Returns:bool if logged in
Since:8.0.0