Files
spring-boot-rest/spring-security-mvc/src/main/java/com/baeldung/session/web/SessionRestController.java

16 lines
477 B
Java

package com.baeldung.session.web;
import javax.servlet.http.HttpSession;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class SessionRestController {
@GetMapping("/session-max-interval")
public String retrieveMaxSessionInactiveInterval(HttpSession session) {
return "Max Inactive Interval before Session expires: " + session.getMaxInactiveInterval();
}
}