title: Spring websocket is automatically closed after 30 minutes (timeout)
body: <p>I'm trying to implement a websocket on using Spring Boot (1.5.13).</p>
  <p>The messaging works fine but after about 30 minutes the connection is terminated by the server (Reason 1008 - &quot;This connection was established under an authenticated HTTP session that has ended&quot;). I've tried to set different timeouts but doesn't seem to have any effect.</p>
  <pre><code>@Service
  @RequiredArgsConstructor
  @Slf4j
  public class OCPPSocketHandler extends TextWebSocketHandler {
      @Override
      public void handleTextMessage(WebSocketSession webSocketSession, TextMessage textMessage)
          throws IOException {
        ...
      }
  }
  
  @Configuration
  @EnableWebSocket
  public class WebSocketConfig implements WebSocketConfigurer {
  
      public static final String ENDPOINT = &quot;/pp/v2.0&quot;;
  
      @Autowired
      private CustomSocketHandler socketHandler;
  
      public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
          registry.addHandler(
              new CustomExceptionWebSocketHandlerDecorator(socketHandler), ENDPOINT
          )
          .setAllowedOrigins(&quot;*&quot;);
      }
  }
  </code></pre>
  <p>application.properties:</p>
  <pre><code>#6h as milliseconds
  server.connection-timeout=3600000 
  server.servlet.session.timeout=6h
  </code></pre>
  <p>A TextMessage (WebSocket) is sent every 30 minutes to keep the connection alive.</p>
  <p>I've seen <a href="https://stackoverflow.com/questions/25930285/spring-websocket-timeout-settings">this question about session timeouts</a> but I can't see a solution there</p>