Giving a URL connection through the function http.connection adds a cookie to the context of the URL connection.
1 http.connection.addCookie
<http.connection.addCookie
name='name'
value='value'
path='path'
domain='domain'
>
<http_connection /> !
</http.connection.addCookie>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Aname | string | Name of the cookie. | |||
Avalue | string | Value of the cookie. | |||
Apath | string | Path of the cookie. | |||
Adomain | string | Domain of the cookie. |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Ehttp_connection | HttpURLConnectionWrapper | URL connection established to a web address. |
Returns | |
---|---|
Type | Description |
string | Returns the cookie added. |
Example
Add a cookie to the context of an URL connection. The function http.connection returns a URL connexion and with http.conection.addCookie adds a new cookie to the context of this URL connection.
Copy
<xsql-script name='http_connection_addcookie'> <body> <set name='m_cookie'> <http.connection.addCookie name='cookie_test' value='value_test'> <http.connection url='http://www.google.es' /> </http.connection.addCookie> </set> <println><m_cookie /></println> </body> </xsql-script>