Class AppSession
java.lang.Object
com.example.wellbeing_project.universal.AppSession
Utility class for managing the application session.
Stores and retrieves the logged-in user's ID.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
Retrives the logged-in user's ID.static void
setLoggedInUserId
(int userId) Sets the logged-in user's ID.
-
Field Details
-
loggedInUserId
public static int loggedInUserId
-
-
Constructor Details
-
AppSession
public AppSession()
-
-
Method Details
-
getLoggedInUserId
public static int getLoggedInUserId()Retrives the logged-in user's ID.- Returns:
- the logged-in user's ID.
-
setLoggedInUserId
public static void setLoggedInUserId(int userId) Sets the logged-in user's ID.- Parameters:
userId
- ID of the user who has logged in.
-