# How to use cookies with HTTP.jl

**URL:** <https://discourse.julialang.org/t/how-to-use-cookies-with-http-jl/74261>\
**Category:** New to Julia\
**Tags:** http\
**Created:** [January 8, 2022, 11:53pm UTC](https://discourse.julialang.org/t/how-to-use-cookies-with-http-jl/74261 "2022-01-08T23:53:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![donk\_fish](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/donk_fish/32/14775_2.png) [@donk\_fish](https://discourse.julialang.org/u/donk_fish)\
**Post date:** [January 8, 2022, 11:53pm UTC](https://discourse.julialang.org/t/how-to-use-cookies-with-http-jl/74261/1 "2022-01-08T23:53:29Z")

</div>

I can’t for the life of me figure out how to successfully scrape a website where I need to login in order to access.

In my browser there’s 4 request cookies (by inspecting an arbitrary GET request)

{  
“Request Cookies”: {  
“xf\_csrf”: “”,  
“xf\_logged\_in”: “”,  
“xf\_session”: “”,  
“xf\_user”: “”  
}  
}

Which I assume I need to pass to HTTP.jl in some way.  
I’ve tried various formats like passing a Dict() with the cookies, but always gets redirected to the login page.

Anyeone have any tips? I presume this is on the stupid side of questions asked in this forum, but I’ve spent like 2 hours now to no avail.

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [January 10, 2022, 1:10pm UTC](https://discourse.julialang.org/t/how-to-use-cookies-with-http-jl/74261/2 "2022-01-10T13:10:28Z")

</div>

There is a `cookies` keyword argument that you can either set to `cookies = true` to let the library manage cookies for you, or you can pass a dictionary with cookies as `cookies = Dict("xf_csrf" => "foo", "xf_logged_in" => "bar", ...)`.

---

<div class="post-metadata">

**Author:** ![lawless-m](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lawless-m/32/30869_2.png) [@lawless-m](https://discourse.julialang.org/u/lawless-m)\
**Post date:** [January 10, 2022, 2:18pm UTC](https://discourse.julialang.org/t/how-to-use-cookies-with-http-jl/74261/3 "2022-01-10T14:18:29Z")

</div>

On a tangent, I would recommend using Burpsuite as a debugging tool when trying to work out the secrets of websites. You use it as a proxy and MITM yourself. You can intercept any and all requests, edit the values etc.

This is the download page, which is a bit blank

> **[Download Burp Suite Community Edition - PortSwigger](https://portswigger.net/burp/communitydownload)**
>
> Burp Suite Community Edition is PortSwigger's essential manual toolkit for learning about web security testing. Free download.

this has a video to show you some of the features

> **[Burp Suite Professional](https://portswigger.net/burp/pro)**
>
> Burp Suite Professional is the world's most popular tool for web security testing. Get a free trial now and identify the very latest vulnerabilities.
