beautypg.com

Os_http_response::cookie ($name), Os_http_response::cookie ($name, $value), Example – Brocade Virtual ADX OpenScript API Guide (Supporting ADX v03.1.00) User Manual

Page 87: Context, Usage, Input parameters, Return values

background image

Brocade Virtual ADX OpenScript API Guide

75

53-1003243-01

Methods

6

Example

OS_HTTP_RESPONSE::cookie ($name)

Returns the cookie value for the cookies specified by the $name variable if it is present, otherwise
undefined is returned.

Context

This function called in http request context will have no effect.

Usage

Can be used to rewrite the cookie value.

Input Parameters

The following table contains the input values.

Return Values

The following table contains the return values.

Example

OS_HTTP_RESPONSE::cookie ($name, $value)

Sets the cookie value to the values specified by $name.

TABLE 79

Input Values

Name

Type

Description

$name

string

A string representing the cookie name.

TABLE 80

Return Values

Name

Type

Description

string

Value of cookie specified by $name. If
not present, undefined is returned.

use OS_HTTP_RESPONSE;

sub HTTP_RESPONSE{

my $content_length = OS_HTTP_RESPONSE::content_length;

}

use OS_HTTP_RESPONSE;

sub HTTP_RESPONSE{

my $server_id = OS_HTTP_RESPONSE::cookie("ServerID");

}