Skip to main content
nevan
Staff
Staff
Oct 12, 2026 3:41 PM UTC

Troubleshooting Tip: Session persistence not supported with TCP virtual server type

Description

This article describes session persistence behavior with virtual TCP servers, which do not support session persistence.

Scope

FortiOS, virtual server load balancer.

Solution

Session persistence, also known as sticky sessions, ensures that subsequent requests belonging to the same user session are forwarded to the same real server instead of being load-balanced to a different backend server. When configuring a FortiGate virtual server with the TCP server type, the Persistence option is not available in the GUI and cannot be configured.

Example:

config firewall vip
    edit "TCP-TYPE"
        set type server-load-balance
        set server-type tcp
        set extip x.x.x.x
        ..
        end
    next
end


When the server type is selected as TCP, there will be no 'set persistence <>' command available, and this is expected. The same setup will also not be available for UDP and IP types. HTTP cookie persistence will work for HTTP and HTTPS server types, and the rest will use persistence with the SSL session ID.

  • HTTP cookie-based persistence: works only with Layer-7 HTTP/HTTPS because FortiGate can inject and read a cookie in the HTTP headers.

  • SSL session ID-based persistence: It works with SSL-terminated protocols (HTTPS, IMAPS, POP3S, SMTPS, SSL) because the FortiGate can track the SSL/TLS session ID.

  • Pure TCP / UDP / IP are Layer-4 (or Layer-3) and have no application-layer identifier that FortiGate can use for stickiness. Therefore, the set persistence command is not present.


Related articles:

    Thought Leadership. Security Summit. Thursday, November 12th, PGA National Resort, Palm Beach Gardens, FL.
    Security Operations Summit: Modernize SecOps. Operate AI-Native.AMER: November 4 | 9:00 AM PST. India and SAARC: November 5 | 10:00 AM IST. EMEA: November 5 | 10:30 AM CET. APAC: November 5 | 11:00 AM SGT