}
public UserDto getUserFromCookie(String loggedInCookie) {
Date twoWeeksAgo = getTwoWeeksAgo();
UserSession userSession = ofy().query(UserSession.class)
.filter("cookie", loggedInCookie)
.filter("dateCreated > ", twoWeeksAgo)
.first().now();
if (userSession == null) {
return null;
}
Long userId = userSession.getUserId();
UserDto userDto = null;
if (userId != null) {
userDto = User.createDto(userDao.get(userId));
}