You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
397 B

package com.lostfound.util;
import com.lostfound.model.User;
import javax.servlet.http.HttpServletRequest;
public class SessionUtil {
public static User getCurrentUser(HttpServletRequest req) {
return (User) req.getSession().getAttribute("user");
}
public static boolean isLoggedIn(HttpServletRequest req) {
return getCurrentUser(req) != null;
}
}