Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
adarshmadrecha
Regular Visitor

Passing Cookie using Web.Contents in PowerBI Desktop

I have API which authenticates user based on Cookies (PHP Sessions)

 

I am using below code to pass cookies

 

= Json.Document(Web.Contents("https://myapp.example.com/api/test.php", [Headers=[Cookie="PHPSESSID:123abc"]]))

But the above code does not work.

Can you please help in finding out what I am doing wrong?

1 ACCEPTED SOLUTION
adarshmadrecha
Regular Visitor

I understood waht the issue was.

Instead of using : I sould use = to scecify cokie name and value.

 

= Json.Document(Web.Contents("https://myapp.example.com/api/test.php", [Headers=[Cookie="PHPSESSID=123abc"]]))

View solution in original post

3 REPLIES 3
adarshmadrecha
Regular Visitor

I understood waht the issue was.

Instead of using : I sould use = to scecify cokie name and value.

 

= Json.Document(Web.Contents("https://myapp.example.com/api/test.php", [Headers=[Cookie="PHPSESSID=123abc"]]))

Good morning. How did you manage to get the cookie from power bi? I am currently making a request to obtain the cookie, said cookie comes in the headers of the server response.

Thank you !

v-chuncz-msft
Community Support
Community Support

@adarshmadrecha,

 

You may take a look at link below.

http://www.excelandpowerbi.com/?p=58

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.