A request hits your Kubernetes cluster. The user is inside a session. Minutes later, the session should expire—but it doesn’t. That’s a problem.
Kubernetes Ingress session timeout enforcement is not baked in by default. Most ingress controllers focus on routing traffic, not managing application-layer timeouts. Without configuration, sessions may live far beyond their intended window, creating a security risk and resource drain.
To enforce session timeouts, you need control at the edge. In Kubernetes, this means configuring your Ingress controller to respect and propagate timeout rules. NGINX Ingress supports custom annotations:
nginx.ingress.kubernetes.io/proxy-read-timeoutnginx.ingress.kubernetes.io/proxy-send-timeout
These set network timeouts, but for true session timeout enforcement you pair them with application logic and cookie policies. With authentication gateways like OAuth2 Proxy, you can set cookie-expire and cookie-refresh to force re-authentication after a defined period.