File tree Expand file tree Collapse file tree 3 files changed +7
-1
lines changed
dhis-api/src/main/java/org/hisp/dhis/system
dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/system
dhis-web-api/src/main/java/org/hisp/dhis/webapi/filter Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ public final class SystemInfo {
6262 @ JsonProperty private final String dateFormat ;
6363 @ JsonProperty private final Date serverDate ;
6464 @ JsonProperty private final String serverTimeZoneId ;
65+ @ JsonProperty private final int sessionTimeout ;
6566 @ JsonProperty private final String serverTimeZoneDisplayName ;
6667 @ JsonProperty private final Date lastAnalyticsTableSuccess ;
6768 @ JsonProperty private final String intervalSinceLastAnalyticsTableSuccess ;
Original file line number Diff line number Diff line change @@ -124,6 +124,7 @@ public SystemInfo getSystemInfo() {
124124 .capability (capabilityProvider .getSystemCapability ())
125125 .calendar (calendarService .getSystemCalendar ().name ())
126126 .dateFormat (calendarService .getSystemDateFormat ().getJs ())
127+ .sessionTimeout (dhisConfig .getIntProperty (ConfigurationKey .SYSTEM_SESSION_TIMEOUT ))
127128 .serverDate (now )
128129 .serverTimeZoneId (tz .getID ())
129130 .serverTimeZoneDisplayName (tz .getDisplayName ())
Original file line number Diff line number Diff line change @@ -64,8 +64,12 @@ protected void doFilterInternal(
6464 long expiresEpochSecond = Instant .now ().plusSeconds (maxInactiveInterval ).getEpochSecond ();
6565 SessionCookieConfig sessionCookieConfig =
6666 request .getServletContext ().getSessionCookieConfig ();
67+ String cookieValue =
68+ String .format (
69+ "server-time:%s/session-expiry:%s" ,
70+ Instant .now ().getEpochSecond (), expiresEpochSecond );
6771 ResponseCookie cookie =
68- ResponseCookie .from (COOKIE_NAME , String . valueOf ( expiresEpochSecond ) )
72+ ResponseCookie .from (COOKIE_NAME , cookieValue )
6973 .maxAge (maxInactiveInterval )
7074 .path ("/" )
7175 .httpOnly (false )
You can’t perform that action at this time.
0 commit comments