Bookmarklet to make session cookies expire later
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开发者_JS百科'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)
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.
精彩评论