swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax     Other Library Functions  
function  

HttpObjectSetCookieValue

 
 

Library: HTTP support (OMHTTP)
Include: omhttp.xin

Declaration

define function HttpObjectSetCookieValue
            modifiable  stream HttpObject
   for      value       stream CookieName
   to       value       stream CookieValue

Argument definitions

HttpObject
is an HTTP request or HTTP response object (input argument).
CookieName
is the name of the cookie (input argument).
CookieValue
is the value to assign to the cookie (input argument).


Purpose

Use HttpObjectSetCookieValue to set a named cookie value in an HTTP request or response object.

Requirements

You must include the following line at the beginning of your OmniMark program:


  include "omhttp.xin"

Usage Notes

Usually, HttpObjectSetCookieValue is called in a server program.

Examples


  ; 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

    Related Syntax
   HttpObjectSetCookieAttribute
   HttpObjectGetCookieValues
 
  Other Library Functions
   HttpConnectionSendResponse
   HttpLibraryVersion
   HttpObjectGetCookieAttributes
   HttpObjectGetCookieValues
   HttpObjectGetHeaders
   HttpObjectGetStatusReport
   HttpObjectIsInError
   HttpObjectSetCookieAttribute
   HttpObjectSetCookieValue
   HttpObjectSetHeader
   HttpRequest
   HttpRequestGetSearchItems
   HttpRequestSend
   HttpRequestSetFromUrl
   HttpRequestSetProxy
   HttpRequestSetSearchItem
   HttpResponse
   HttpResponseOutput
   HttpServiceAwaitRequest
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:27:39 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.