Use the SoapPBCookie class to get or set cookies for the Web service.
SoapPBCookie has the following methods:
Gets a comment that the server provides with a cookie.
acookie.GetComment ( )
Argument |
Description |
---|---|
acookie |
The name of an instance of the SoapPBCookie object |
String. Returns a comment provided with the cookie.
An optional comment added by the server typically includes information about privacy policy or intended uses of the cookie.
Gets a URI comment that the server provides with a cookie.
acookie.GetCommentUri ( )
Argument |
Description |
---|---|
acookie |
The name of an instance of the SoapPBCookie object |
String. Returns a URI comment provided with the cookie.
An optional comment added by the server that represents the intended use of the URI reference for the cookie.
Gets the current state of a cookie.
acookie.GetExpired ( )
Argument |
Description |
---|---|
acookie |
The name of an instance of the SoapPBCookie object |
Boolean. Returns true if the cookie has expired. Otherwise, returns false.
Gets the expiration date and time for a cookie.
acookie.GetExpires ( )
Argument |
Description |
---|---|
acookie |
The name of an instance of the SoapPBCookie object |
DateTime. Gets the expiration date and time of a cookie.
A session cookie returns a DateTime value of January 1, 0001, 00:00:00.0000000.
Gets the accessibility of a cookie to page scripts or other active content.
acookie.GetHttpOnly ( )
Argument |
Description |
---|---|
acookie |
The name of an instance of the SoapPBCookie object |
Boolean. Returns false when a page script or other active content is able to access the cookie. Otherwise, returns true.
Gets the name of a cookie.
acookie.GetName ( )
Argument |
Description |
---|---|
acookie |
The name of an instance of the SoapPBCookie object |
String. Returns the name of the cookie.
For an example using GetName, see the description for the PBGetCookies function in the PowerScript Reference.
Gets the security level of a cookie.
acookie.GetSecure ( )
Argument |
Description |
---|---|
acookie |
The name of an instance of the SoapPBCookie object |
Boolean. Returns true if HTTPS is required. Otherwise, returns false.
Gets the time when the cookie was issued.
acookie.GetTimeStamp ( )
Argument |
Description |
---|---|
acookie |
The name of an instance of the SoapPBCookie object |
DateTime. Gets the date and time when the cookie was issued.
Gets the URI for which the cookie is valid.
acookie.GetURI ( )
Argument |
Description |
---|---|
acookie |
The name of an instance of the SoapPBCookie object |
String. Returns the URI.
Gets the value of the cookie.
acookie.GetValue ( )
Argument |
Description |
---|---|
acookie |
The name of an instance of the SoapPBCookie object |
String. Returns the cookie value.
Gets the version of the HTTP state maintenance to which a cookie conforms.
acookie.GetVersion ( )
Argument |
Description |
---|---|
acookie |
The name of an instance of the SoapPBCookie object |
Integer. Returns 1 if the cookie conforms to RFC 2109, and 2 if the cookie conforms to RFC 2965.
Sets a comment that the server can add to a cookie.
acookie.SetComment ( string comment )
Argument |
Description |
---|---|
acookie |
The name of an instance of the SoapPBCookie object |
comment |
String for a comment that you want the server to provide with a cookie |
Long. Returns 0
for
success, and 50
for failure.
Comments are optional. Typical comments include information about privacy policy and intended use of a cookie.
Sets a comment.
acookie.SetCommentURI ( string commentUri )
Argument |
Description |
---|---|
acookie |
The name of an instance of the SoapPBCookie object |
commentUri |
String for a URI comment that you want the server to provide with a cookie |
Long. Returns 0
for
success, and 50
for failure.
URI comments are optional, but must conform to the URI format when used. Typical URI comments include information about how the server uses a cookie.
Sets the state of a cookie.
acookie.SetExpired ( boolean expired )
Argument |
Description |
---|---|
acookie |
The name of an instance of the SoapPBCookie object |
expired |
Set to true if you want to terminate the cookie. The expired value is false by default. |
Long. Returns 0
for
success, and 50
for failure.
Sets the expiration date and time for a cookie.
acookie.SetExpires ( datetime expires )
Argument |
Description |
---|---|
acookie |
The name of an instance of the SoapPBCookie object |
expires |
A DateTime value for the expiration date and time you want to set for a cookie |
Long. Returns 0
for
success, and 50
for failure.
You set a session cookie by entering a DateTime value of January 1, 0001, 00:00:00.0000000.
Determines whether a cookie can be accessed by page scripts or other active content.
acookie.SetHttpOnly ( boolean httpOnly )
Argument |
Description |
---|---|
acookie |
The name of an instance of the SoapPBCookie object |
httpOnly |
Set to true if you want to restrict cookie to HTTP access only. Set to false if you want page scripts or other active content to be able to access the cookie. |
Long. Returns 0
for
success, and 50
for failure.
Sets the name for a cookie.
acookie.SetName ( string name )
Argument |
Description |
---|---|
acookie |
The name of an instance of the SoapPBCookie object |
name |
The name that you want to set for the cookie |
Long. Returns 0
for
success, and 50
for failure.
The name must be initialized before setting an instance of the Cookie class. The following characters cannot be used for the cookie name: equal sign (=), semicolon (;), comma (,), new line (\n), return (\r), and tab (\t). The dollar sign ($) cannot be used as the first character in the name.
Cookies are considered the same if the values of both their URI and name are the same. If a cookie already exists in the Web service with the same name and URI, it will be replaced with the new cookie when you call a Web service method.
For an example using SetName, see the description for the PBAddCookie function in the PowerScript Reference.
Sets the security level for a cookie.
acookie.SetSecure ( boolean secure )
Argument |
Description |
---|---|
acookie |
The name of an instance of the SoapPBCookie object |
secure |
Set this to true if you want the client to return the cookie only when Secure Hypertext Transfer Protocol (HTTPS) is used. |
Long. Returns 0
for
success, and 50
for failure.
SetSecure is false by default.
Sets the URI for which the cookie is valid.
acookie.SetURI ( string uri )
Argument |
Description |
---|---|
acookie |
The name of an instance of the SoapPBCookie object |
uri |
The URI for which the cookie is valid |
Long. Returns 0
for
success, and 50
for failure.
The URI value you set must conform to the URI format.
Sets the value for a cookie.
acookie.SetValue ( string value )
Argument |
Description |
---|---|
acookie |
The name of an instance of the SoapPBCookie object |
value |
A string value that you want to set for the cookie |
Long. Returns 0
for
success, and 50
for failure.
Semicolons and commas cannot be used in the value that you set for a cookie.
Sets the HTTP state maintenance version to which a cookie conforms.
acookie.SetVersion ( int version )
Argument |
Description |
---|---|
acookie |
The name of an instance of the SoapPBCookie object |
version |
The HTTP version to which you want the cookie to conform. |
Long. Returns 0
for
success, and 50
for failure.
If you set version to 1, the cookie must conform to RFC 2109. If you set the cookie to 2, the cookie must conform too RFC 2965.