Retreiving the values of all cookies

read_cookie_values()

Retreiving the value of all cookies


SYNTAX

read_cookie_values(record_id)

Read all cookies stored on the user’s machine by this web server, and store their values in the temporary record structure specified in record_id.

A temporary record structure is declared by !record, its field list either being explicitly defined within the structure, or copied from that of a file or record already declared. The fields in the record_id specified for this function must have the same names as the cookies whose values are required. Each value is automatically converted to the type of the corresponding field.

Note: Since Sculptor version 6.2.0 the nested record and record array features are supported, when reading cookies a subrecord and indexes can be specified (see example below)

The function returns the number of values stored.


NOTES


EXAMPLE

Since Sculptor version 6.2.0 the HTTP_COOKIE (cgi standard environment variable) may reference fields in subrecords like "main=Main; subRec[2].nested[2]=Nested" and then can be read like this:

!record cookieRec {
  main,,a8
  !record subRec[4] {
    nested,,a8[3]
  }
}
!temp cookiesRead,,i4

cookiesRead = read_cookie_values(cookieRec)

RELATED TOPICS

Creating web pages with Sculptor

Internet functions

!record