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

HttpObjectSetCookieValue

 
 

Library: Net, 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 ] [ LEGACYLIBRARIES ] [ ERRORS ]

OmniMark 7.1.2 Documentation Generated: June 28, 2005 at 5:45:18 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © Stilo Corporation, 1988-2005.