Thanks Tim, that's a reasonable question - I'm using wraith to capture
screen shots, and the tool requires additional scripting to handle a
user login. The problem is that it spawns separate casperjs processes
to capture specific selectors. I have a global script that immediately
authenticates via form login, but there were other issues preventing
me from knowing whether that auth info was shared for specific
'component' captures. In wraith, one can specify a selector for a
page, and it handles the capturing/image diffing of the page element.
This means that while my initial script may auth correctly, subsequent
captures may have not - I wanted to check for the presence of a cookie
parameter in my global script to verify this, and on failure, execute
an explicit script to login. The risk without that check, is that the
global script may *always* execute a form fill/login, waisting
resources. The second objective was to store cookie info from the
initial auth routine, and direct newer casper sessions to use that for
the duration of the entire wraith session.
I'm using JS, but thanks for the coffeescript, I believe I can make
sense from this.
Best,
Neha