function
Library: HTTP support (OMHTTP)
Include: omhttp.xin |
define function HttpObjectSetCookieValue modifiable stream HttpObject for value stream CookieName to value stream CookieValue
Argument definitions
Use HttpObjectSetCookieValue to set a named cookie value in an HTTP request or response object.
You must include the following line at the beginning of your OmniMark program:
include "omhttp.xin"
Usually, HttpObjectSetCookieValue
is called in a server program.
; HttpObjectSetCookieValue include "omhttp.xin" process local HttpRequest my-Request local HttpResponse my-Response HttpObjectSetCookieValue my-Request for "DocUserID" to "123abc456" HttpObjectSetCookieValue my-Response for "DocUserID" to "123abc456"
Set cookie values and list them:
;HttpObjectSetCookieValue Example 2 include "omhttp.xin" process local HttpRequest my-Request local HttpResponse my-Response local stream request-Cookies variable local stream response-Cookies variable HttpObjectSetCookieValue my-Request for "DocUserID" to "123abc456" HttpObjectSetCookieValue my-Response for "DocUserID" to "123abc456" HttpObjectGetCookieValues my-Request into request-Cookies HttpObjectGetCookieValues my-Response into response-Cookies output "Request cookies:%n" repeat over request-Cookies output key of request-Cookies || "=%g(request-Cookies)%n" again output "%nResponse cookies:%n" repeat over response-Cookies output key of response-Cookies || "=%g(response-Cookies)%n" again