6

I need to see the value of a cookie in Safari on an iPhone. How do I do this?

Note that I'm not asking how to delete a cookie, or how to see that a cookie exists. I'm trying to see the actual data stored in a cookie.

For example, on Firefox, I can go to Tools > Options > Privacy > Show Cookies and see the actual data stored in each cookie my browser has stored.

10

You can't see cookie data on the phone itself, but if you activate Settings > Safari > Advanced > Web Inspector you can connect the iPhone to an Apple computer with a cable and open Safari. Activate the Develop menu in Preferences > Advanced > Show Develop menu in menu bar

Now you can open a page on the iPhone and then select Develop > your_phone > the_page on the computer to see an inspector for the page on the phone. The second icon at the top is for storage and will show cookies for the page you show on the phone.

Sadly I can't find a way to show all cookies on the phone but if it is for development it is possible to monitor the cookie data.

  • What if you don't have an Apple computer? – Joe Dec 17 '12 at 23:03
  • 1
    I'm unsure if this works on Windows but you can give it a try. I would have done that but not owning a windows computer. – Hoshts Dec 17 '12 at 23:06
  • @Joe Safari installes on Windows OS as well as Mac OS. You might need another tool or have to run one of the supported OS in emulation if you want to use this method. – bmike Dec 23 '13 at 13:53
  • Want to inspect cookies on your iPad? "There's a MAC for that" – nclord Jul 1 '15 at 9:15
0

type the following in your iPhone browser address bar and hit GO

javascript:alert(document.cookie)
  • 1
    Doesn't work. It says "Cannot Run Script" – Paul Razvan Berg Sep 29 at 2:11
0

I have been struggling with this just today. What is sure, is that you cannot execute any JS script by using url method no more.

I found a sollution to add edit or view specyfic websites cookies by faking them. I own jailbroken iPad so all I had to do was to edit hosts file in /etc/ location and redirect needed domain to my own local php server and then I could do whatever I want.

Of course, not everybody use jailbroken device, so I think other similar method would be to run dnsspoof in your local network and do the same but it will be probably little more difficult.

I had to do this because I have older version of iOS system (10.3.1) which does not handle latest CSS standard correctly and one of my favorite websites put huge alert about cookies and EU acceptance, and I wasn't able to click that d*mn AGREE button (was overflown by some text). Because of that I couldn't surf that website at all.

So I added cookie which tells website that I already clicked agree :D then I reverted hosts file to previous state and voila

Hope that'll help somebody

-1

The javascript:alert(document.cookie) only shows the site url on safari on ios 6.1.2 on iphone 4S.

Maybe it's due to the fact that it's an https site ?

  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post once you have sufficient reputation. – grg Dec 23 '13 at 12:28
-2

You can open the same site in Safari on a Mac and use the web inspector to check for the cookie values.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .