Fortinet white logo
Fortinet white logo

Script Reference Guide

HTTP:redirect_with_cookie(url, cookie)

HTTP:redirect_with_cookie(url, cookie)

Redirects an HTTP request or response to the specified URL with cookie.

Supports multiple redirect

Syntax

HTTP:redirect_with_cookie(url, cookie);

Arguments

Name Description

url

A string which specifies the redirect url.

cookie

A string as cookie.

Events

Applicable in the following events:

  • HTTP_REQUEST

  • HTTP_DATA_REQUEST

  • HTTP_RESPONSE

Note: Cannot be used in HTTP_DATA_RESPONSE.

Example

HTTP:redirect_with_cookie("www.example.com", "server=nginx")
HTTP:redirect_with_cookie("www.abc.com", "server=nginx")

The final redirection is to www.abc.com with the cookie "server=nginx".

Supported Version

FortiADC version 4.8.x and later.

HTTP:redirect_with_cookie(url, cookie)

HTTP:redirect_with_cookie(url, cookie)

Redirects an HTTP request or response to the specified URL with cookie.

Supports multiple redirect

Syntax

HTTP:redirect_with_cookie(url, cookie);

Arguments

Name Description

url

A string which specifies the redirect url.

cookie

A string as cookie.

Events

Applicable in the following events:

  • HTTP_REQUEST

  • HTTP_DATA_REQUEST

  • HTTP_RESPONSE

Note: Cannot be used in HTTP_DATA_RESPONSE.

Example

HTTP:redirect_with_cookie("www.example.com", "server=nginx")
HTTP:redirect_with_cookie("www.abc.com", "server=nginx")

The final redirection is to www.abc.com with the cookie "server=nginx".

Supported Version

FortiADC version 4.8.x and later.