User session timeout issues on the WAF-protected web application. After two or three minutes, the session closes, but response times when making requests or navigating within the application are functioning accordingly.

Juan Eduardo Diaz 20 Reputation points
2025-05-27T13:44:52.45+00:00

User session timeout issues on the WAF-protected web application. After two or three minutes, the session closes, but response times when making requests or navigating within the application are functioning accordingly.

The logs within the login have been reviewed and no time periods exceeding 15 or 20 seconds have been found. However, user sessions are constantly being closed.

Azure Web Application Firewall
{count} votes

1 answer

Sort by: Most helpful
  1. Venkat V 2,545 Reputation points Microsoft External Staff Moderator
    2025-05-28T10:56:44.69+00:00

    Hi Juan Eduardo Diaz

    If your Application Gateway is using HTTP/2, the TCP idle timeout is hardcoded to 180 seconds (3 minutes) by default and cannot be modified.

    For HTTP/1.1, the Keep-Alive timeout is 120 seconds (non-configurable), and the TCP idle timeout is 4 minutes by default on public IPs—but this can be increased up to 30 minutes. If you're using a private IP, the idle timeout is fixed at 5 minutes.

    User's image

    User's image

    Ref: What are the settings for Keep-Alive timeout and TCP idle timeout?

    Check if the suggestion below can resolve your issue.

    Check if HTTP/2 is enabled and test with it disabled temporarily.

    $appgateway = Get-AzApplicationGateway -Name test -ResourceGroupName hm
    $appgateway.EnableHttp2 = $false
    Set-AzApplicationGateway -ApplicationGateway $appgateway
    

    Consider enabling session affinity (cookie-based affinity) if not already configured enable by navigating to Backend settings and select your backend settings and enable

    Once you enable the cookie-based affinity setting for the service, it directs subsequent traffic from the same user session to the same backend server for processing. follow the Enable cookie-based affinity with Application Gateway
    User's image

    I hope this helps to resolve your issue. Please feel free to ask any questions if the solution provided isn't helpful.

    Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.