# Cookies and the URI module

**URL:** <https://forum.ansible.com/t/cookies-and-the-uri-module/25843>\
**Category:** Ansible Project\
**Created:** [October 27, 2017, 3:54pm UTC](https://forum.ansible.com/t/cookies-and-the-uri-module/25843 "2017-10-27T15:54:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mathias\_Ettinger](https://avatars.discourse-cdn.com/v4/letter/m/d6d6ee/32.png) [@Mathias\_Ettinger](https://forum.ansible.com/u/Mathias_Ettinger)\
**Post date:** [October 27, 2017, 3:54pm UTC](https://forum.ansible.com/t/cookies-and-the-uri-module/25843/1 "2017-10-27T15:54:46Z")

</div>

Hi all,

I am using the URI module to contact a REST service of my own that I just deployed in the same playbook. I just happened to add user authentication to this service and I need the URI module to handle that.

I successfully POSTed a request to the login route and got a cookie in response authenticating the user.

Starting with ansible 2.4.0.0, I can retrieve this cookie in the cookies dictionary of the URI module response by its name and use it in subsequent URI calls with a specific Cookie header.

But the cookies dictionary is not present in the response of the URI module of previous versions. How can I perform the same using ansible 2.3.2 or even 2.2 ? Does the URI module support sessions in some ways ?
