|
Send Cookie to browser, can be used for either Netscape Cookie or SetCookie2 Cookie
Method of WebRainbow.DynaPage
Systax
- Sub SetCookie( sName As String,
sValue As String,
[sExpires As String],
[sDomain As String],
[sPath As String],
[sSecure As String],
[sComment As String],
[sCommentURL As String],
[sDiscard As String],
[sPort As String],
[sVersion As String] )
Where
- The required argument sName is any valid string
expression.
- The required argument sValue is any valid string
expression.
- The optional argument sExpires is a string expression for
seconds the cookie expires, including digit(s) only.
- The optional argument sDomain is any valid string
expression.
- The optional argument sPath is any valid string
expression.
- The optional argument sSecure is a string expression of
either "0" or "1", see Values section bellow for details.
- The optional argument sComment is any valid string
expression.
- The optional argument sCommentURL is any valid string
expression.
- The optional argument sDiscard is a string expression of
either "0" or "1", see Values section bellow for details.
- The optional argument sPort is a string expression which
includes digit(s) only.
- The optional argument sVersion is a string expression of
either "0" or "1", see Values section bellow for details.
Values
- sSecure:
- 0 -- Not secure
- 1 -- Secure
sDiscard:
- 0 -- Not discard
- 1 -- Discard
sVersion:
- 0 -- Netscape Cookie
- 1 -- SetCookie2 Cookie (Version 1 Cookie which uses SetCookie2 to send cookie)
Constants
- In WebRainbow.Cookie there are 6
pre-defined cookie field Constants can be used for
SetCookie only:
Remarks
- SetCookie will select either SetCookie or
Set-Cookie2 request header automatically based on browser's
supported cookie version, regardless of the arguments passed to
SetCookie. Therefor WebRainbow guaranties the cookie can
be accepted by browser.
- If the value of argument sValue contains certain special
characters, such as Tab, Space, Semicolon,
comma, or the other character that should be encoded by URL
encoding, please first encode them using function
Chr2Hex provided by WebRainbow
before pass sValue to SetCookie.
- WebRainbow defined a constant
ceEncodeChar for such URL-encoding special
to cookie.
- The value for argument sExpires should be in seconds, for
example: "86400" for 24 hours, WebRainbow will convert it to
appropriate format for the cookie.
- If using Non-Parsed Header (nph) output, WebRainbow will
buffer the sending cookie(s) until SetCgiHeader is called
successfully.
- After SetCgiHeader is called successfully, no more
cookie(s) can be sent.
- Using pre-defined cookie field constants is recommended.
- For Visual Basic 4 32-bit Version, vbNullString should be
used in the place of optional argument if there is no value assigned to
it
|