Giving a URL connection established through the function htto.connection returns the value of a cookie indicated through
the attribute name.
1 http.connection.getCookie
<http.connection.getCookie name='name'>
<http_connection /> !
</http.connection.getCookie>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Aname | string | Name of the cookie. |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Ehttp_connection | HttpURLConnectionWrapper | Conexión URL establecida a una dirección web. |
Returns | |
---|---|
Type | Description |
string | Returns the value of the indicated cookie of the established URL connection. |
Example
Obtain the value of a cookie of an URL connection. The function http.connection returns an URL connection and with http.conection.getCookie is obtained the value of the cookie /PREF.
Copy
<xsql-script name=''> <body> <!-- GET COOKIE --> <set name='m_cookie'> <http.connection.getCookie name='/PREF'> <http.connection url='http://www.google.es' /> </http.connection.getCookie> </set> <!-- GET COOKIE NAME --> <print>NAME: </print> <println><http.connection.getCookieName><m_cookie /></http.connection.getCookieName></println> <!-- GET COOKIE VALUE --> <print>VALUE: </print> <println><http.connection.getCookieValue><m_cookie /></http.connection.getCookieValue></println> <!-- GET COOKIE PATH --> <print>PATH: </print> <println><http.connection.getCookiePath> <m_cookie /> </http.connection.getCookiePath> </println> <!-- GET COOKIE DOMAIN --> <print>DOMAIN: </print> <println><http.connection.getCookieDomain> <m_cookie /> </http.connection.getCookieDomain> </println> </body> </xsql-script>