Package passport.infra
Class Session
java.lang.Object
passport.infra.Session
Manages the session state for a logged-in user. This class is placed in the
infra folder because it handles session management and in-memory persistence,
which are concerns related to the application's infrastructure.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
Session
public Session()Constructs an empty session.
-
-
Method Details
-
loggedAs
-
logInAs
Logs in as the specified user.- Parameters:
user
- the user to log in as
-
logOut
public void logOut()Logs out the current user. -
isActive
public boolean isActive()Checks if a user is currently logged in.- Returns:
- true if a user is logged in, false otherwise
-
loggedUser
-