Basic VSP Programming
VS-B-9 Header Parsing Functions
Header Parsing Functions (Cookie Example)
Preliminaries
- The HTTP request header contains lines of request information.
- Every user-agent (browser) sends at least one request line to the Web server.
- The "lines" argument in VSPs is an array of the user-agent request lines.
Methods for accessing the request parameters
- A specific attribute can be accessed with the http_request_header() function.
- The header lines can be accessed with aref() function.
- Parsing the header line can be done with the split_and_decode() function.
Cookie Demo
This example shows how to set a cookie in the user-agent, and displaying a cookie string when retrieved.
- Setting the cookie is done with the http_header() function. (see also:VS-B-5)
- Retrieving the cookie string is done with http_request_header() function.
| View the source | Action |
|---|---|
| 1. vs_b_9_sample_1.vsp | Run |
OpenLink Home
Technical Support