Skip to content

Commit

Permalink
core: Added Session.setDestroyTime(..) API to change session length
Browse files Browse the repository at this point in the history
  • Loading branch information
cederberg committed Sep 4, 2023
1 parent 070026e commit a055401
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/java/org/rapidcontext/core/type/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,20 @@ public Date destroyTime() {
return dict.getDate(KEY_DESTROY_TIME, new Date(Math.min(access, create)));
}

/**
* Sets the scheduled session destruction timestamp.
*
* @param date the destruction timestamp, or null for default
*/
public void setDestroyTime(Date date) {
if (date == null) {
dict.remove(KEY_DESTROY_TIME);
} else {
dict.set(KEY_DESTROY_TIME, date);
}
modified = true;
}

/**
* Returns the session last access timestamp.
*
Expand Down

0 comments on commit a055401

Please sign in to comment.