I have a problem I'm trying to debug with there being too many cookies by the time a user gets to our checkout page. I've written a script to detect every time a cookie is set via set-cookie header or a javascript file with document.cookie = something is sent to the client. I need the url, cookie name, expiration, domain, and path. I've got the script getting all the data I need, but I can't figure out how to write it to a log file.
I can do streamwriter, but run into file locking issues because there are multiple threads for different requests. Is there a threadsafe way to log built in? I can't figure out how to use log4net or nlog from inside fiddlerscript. I guess the other option is to make my cookies arraylist object global and just keep adding the cookies to it and then write it all out at once at end. If I choose that direction how would I trigger it writing out the log when I was ready? Thanks for your help.
- Ray