views:

20

answers:

1

Background: There are several sites that I visit regularly on my iPhone that require me to log in. Unfortunately, the sites set cookies that expire at the end of the session. This unfortunately means I end up having to log in up to a dozen times per day.

I would like to write a bookmarklet that will go through and change all my 'expires at end of session' cookies to 'expires in 1 week.' I'm new to JavaScript/bookmarklets (I am a C++/C# programmer)... so I have a feeling this might take me a while. I just wanted to consult with experts who might be able to tell me if this is feasible/possible at all to begin with. I don't want to end up wasting my time if it's not even possible to accomplish this via JavaScript. (and if it matters, I use 'Atomic Browser' on the iPhone which does have bookmarklet support)

A: 

Well, there are bookmarklets that allow you to view all cookies set by the current site, so I don't see any reason why this wouldn't be possible. If anything, you'd just need to enumerate/grab all the cookies, and then re-set them using a new expiration time/date.

Lèse majesté
Thanks. I was able to find a script that expired all cookies. Looking at it I see it just set all cookies to expire at a date in the past. I just changed the minus to a plus and it seems to be working now!
BrowsingOnMyiPhone
Good call. You might want to post it (your modifications + a link to the original) up as an answer.
Lèse majesté