How can I clear 2 specific cookies for a site?

Discussions and Tech Support specific to the iMacros Firefox Add-on.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
soundplay
Posts: 2
Joined: Sat Apr 30, 2016 8:44 am

How can I clear 2 specific cookies for a site?

Post by soundplay » Sun May 01, 2016 9:30 am

Hello
Firefox 45.0.1
Yosemite 10.10.1

I have created my first iMacro successfully! Yah! (iMacro is correctly clicking the buttons and printing based on user definted variables.)

Next step is work out how to automatically clear 2 specific site cookies after processing the steps and then loop.
I am currently manually clearing the cookies using the Fx Addon Cookie Controller - takes 3 steps (enter search string, select the 2 cookies, click remove selected button)
After I have cleared the cookies, then I need to loop so iMacro then repeats the steps I entered in the macro.

Can iMacro Fx clear only 2 specific site cookies?

In reference wiki it meantions CLEAR command. Reading CLEAR implies clears all cookies. I want to clear only the 2 related to the site.

Thankyou for you help
chivracq
Posts: 8980
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How can I clear 2 specific cookies for a site?

Post by chivracq » Sun May 01, 2016 2:07 pm

soundplay wrote:Hello
Firefox 45.0.1
Yosemite 10.10.1

I have created my first iMacro successfully! Yah! (iMacro is correctly clicking the buttons and printing based on user definted variables.)

Next step is work out how to automatically clear 2 specific site cookies after processing the steps and then loop.
I am currently manually clearing the cookies using the Fx Addon Cookie Controller - takes 3 steps (enter search string, select the 2 cookies, click remove selected button)
After I have cleared the cookies, then I need to loop so iMacro then repeats the steps I entered in the macro.

Can iMacro Fx clear only 2 specific site cookies?

In reference wiki it meantions CLEAR command. Reading CLEAR implies clears all cookies. I want to clear only the 2 related to the site.

Thankyou for you help
FCIM...! iMacros Version missing... => v8.9.7 I reckon...

But, yep, correct, 'CLEAR' will clear all Cookies indeed... You could use a dedicated FF Profile, or you can probably do it from JavaScript, I see several Threads on Stackoverflow like this one for example:
- http://stackoverflow.com/questions/1059 ... ie-by-name
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
soundplay
Posts: 2
Joined: Sat Apr 30, 2016 8:44 am

Re: How can I clear 2 specific cookies for a site?

Post by soundplay » Mon May 02, 2016 6:03 am

VERSION BUILD=8970419 RECORDER=FX
(sorry tried to edit it after submit, but it needed to be moderated first)
---
thankyou for your reply.
I think you are saying not possible natively in iMacros. Natively I mean by a iMacro function/command/expresssion.
Correct?

1) A dedicated profile for imacro (so i can clear 2 specific cookies) is not user friendly / feasible from a usability perspective.
2) Removing 2 specific cookies, programmatically, (javascript) requires scripting knowledge. I do not have this.
I did read the stack posts and many others. There is not a clear-cut way for a person with no scripting knowledge. One post says its possible to trick Fx to deleting by setting the cookie expiration into the past. Then another post says this does not work for session cookies. There are other suggestion but none I found with success that I could cut and paste and simply change my cookie name.The 2 cookies I wish to remove are session cookies not persistant cookies.

I had hoped/assumed iMacros could work with the full Fx environment. e.g. support utilising other Fx add-ons installed. (e.g. Cookie Controller Fx Addon). This is what I use to do the steps manually e.g.
1) click cookie controller/cookies on my addon bar
2) enter search string to be able to select the desired cookies
3) click remove selected cookies button

If there is some sample script that imacros would work with, that would be helpful. Otherwise I am thinking I have to abort using iMacro as not able to do it natively.

Thankyou.
chivracq
Posts: 8980
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How can I clear 2 specific cookies for a site?

Post by chivracq » Mon May 02, 2016 2:55 pm

soundplay wrote:VERSION BUILD=8970419 RECORDER=FX
(sorry tried to edit it after submit, but it needed to be moderated first)
---
thankyou for your reply.
I think you are saying not possible natively in iMacros. Natively I mean by a iMacro function/command/expresssion.
Correct?

1) A dedicated profile for imacro (so i can clear 2 specific cookies) is not user friendly / feasible from a usability perspective.
2) Removing 2 specific cookies, programmatically, (javascript) requires scripting knowledge. I do not have this.
I did read the stack posts and many others. There is not a clear-cut way for a person with no scripting knowledge. One post says its possible to trick Fx to deleting by setting the cookie expiration into the past. Then another post says this does not work for session cookies. There are other suggestion but none I found with success that I could cut and paste and simply change my cookie name.The 2 cookies I wish to remove are session cookies not persistant cookies.

I had hoped/assumed iMacros could work with the full Fx environment. e.g. support utilising other Fx add-ons installed. (e.g. Cookie Controller Fx Addon). This is what I use to do the steps manually e.g.
1) click cookie controller/cookies on my addon bar
2) enter search string to be able to select the desired cookies
3) click remove selected cookies button

If there is some sample script that imacros would work with, that would be helpful. Otherwise I am thinking I have to abort using iMacro as not able to do it natively.

Thankyou.
Natively clear only specific Cookies, well, no, afaik, it's only possible to clear ALL Cookies with the 'CLEAR' Command like you had already found out...

I thought I had some easy Workaround for you by using 'FILEDELETE' and delete your specific Cookies one by one, but oops...!, Cookies in FF are stored in 'cookies.sqlite' and not as Standalone Files... I guess you could delete/replace/restore this 'cookies.sqlite' before/after killing/(re)starting/closing FF and running your Macro from a '.BAT' File, but I guess that's even less User Friendly than the Dedicated FF Profile Option...

Using the Solutions from Stackoverflow shouldn't be very difficult, it's just a question of specifying your Cookie Name and Path and you can use that piece of Code directly if you run your Macro Script from a '.js' Script.
It is even possible to run it directly from an '.iim' Macro with the 'URL GOTO=javascript:xxx' Syntax, you'll just need to replace the Spaces with '<SP>', and escape the Backslashes in the Path...

But I searched the Forum a bit and it looks like you are not the first one to ask for such a Feature, from back in 2010 actually in this Thread and TechSupport mentioned in 2010 (some 6 years ago...!) that it had been added this to the feature request list:
by Tom, Tech Support on 17 Dec 2010, 20:04 wrote:
by buckley on 16 Dec 2010, 12:16 wrote:Hello Support,

Please add support to only delete the cookies of the current domain as It currently delete all of my cookies which is really not desirable.

I know this is possible because I use it in the developer toolbar :
16-12-2010 11-03-24.jpg
What are your thoughts on this?

Regards, Tom
Very good suggestion! I have added this to our feature request list.
A similar Enh Req had already been added as well 6 month earlier in this Thread:
by Tech Support on 27 Apr 2010, 18:20 wrote:
CLEAR mysite.com
Great idea - I created the internal ticket fx450 for it.
Time to bump those Threads, I would think...!

But some other Workaround could be to play with 'Export/Import' your Cookies to reach the same Result like deleting specific Cookies, like explained in this Thread:
- Please add a way to import and export cookies
But it looks more complex I would think then the Option to directly delete specific Cookies from JavaScript...

Some other Solution looked promising in this Thread, by protecting/locking the Cookies that you wanted to keep using some FF Add-on but it didn't work in the end:
by Dimar on 10 May 2015, 04:14 wrote:What happens is that CookieKeeper, protect the Cookies you want, as long as, deleting cookies is done through CK.

By using "CLEAR" using IMACRO, CK makes no protection.
Which brings me to your Qt about iMacros interacting with your 'Cookie Controller' FF Add-on, nope, iMacros only interacts with the Web-Page/Content and Interaction with the DOM is very limited.

Well..., so those are the Options using iMacros...!
Even if you finally choose for some Solution outside of iMacros, it would still be interesting if you could come back in a while once you've found a Working Solution for your Needs and share it, that might even work motivating for iMacros TechSupport/Dev to finally implement this Functionality into iMacros if they see that some competitive Product is able to delete only specific Cookies...!
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Post Reply