in juneau-petstore-server/src/main/java/org/apache/juneau/petstore/rest/PetStoreResource.java [477:492]
public Ok login(
String username,
String password,
Value<ExpiresAfter> expiresAfter
) throws InvalidLogin, NotAcceptable {
RestRequest req = getRequest();
if (! store.isValid(username, password))
throw new InvalidLogin();
Date d = new Date(System.currentTimeMillis() + 30 * 60 * 1000);
req.getSession().setAttribute("login-expires", d);
expiresAfter.set(new ExpiresAfter(d));
return OK;
}