Giving a URL connection established through the function htto.connection returns a map (map <string, cookie>) with the cookies of the context of the application or null if there is not.

1 http.connection.getCookies

<http.connection.getCookies>
    <http_connection /> !
</http.connection.getCookies>
Example

Obtain the cookies of an URL connection. The function http.connection returns an URL connection and with http.connection.getCookies the cookies of the URL connection are obtained. In the example the name, the value, the path and the track of the cookies are obtained.

Copy
<xsql-script name='http_connection_cookies'>
    <body>
        <!-- GET COOKIES -->
        <set name='map_cookies'>
            <http.connection.getCookies>
                <http.connection url='http://www.yahoo.com' />
            </http.connection.getCookies>
        </set>

        <println><map_cookies /></println>

        <iterator name='item_cookie' type='entry'>
            <in>
                <map_cookies/>
            </in>
            <do>
                <!-- GET COOKIE NAME        -->
                <print>NAME: </print>
                <println><http.connection.getCookieName><item_cookie /></http.connection.getCookieName></println>

                <!-- GET COOKIE VALUE       -->
                <print>VALUE: </print>
                <println><http.connection.getCookieValue><item_cookie /></http.connection.getCookieValue></println>


                <!-- GET COOKIE PATH       -->
                <print>PATH: </print>
                <println><http.connection.getCookiePath>
                        <item_cookie />
                    </http.connection.getCookiePath>
                </println>

                <!-- GET COOKIE DOMAIN       -->
                <print>DOMAIN: </print>
                <println><http.connection.getCookieDomain>
                        <item_cookie />
                    </http.connection.getCookieDomain>
                </println>
            </do>
        </iterator>
    </body>
</xsql-script>