Hi Norman,<div><br></div><div>I&#39;m not sure if you&#39;re using the Twill commands module, the Browser object, or twill-sh; but it looks like regardless there&#39;re both the methods &quot;save_cookies&quot; and &quot;load_cookies&quot; -- the former saves the contents of your cookie jar to a file, and the latter replaces your cookie jar&#39;s contents with those of a file.</div>
<div><br></div><div>Unfortunately, that means you can&#39;t just &quot;insert&quot; a cookie, as far as I can tell.  But, to get the functionality you want, I believe you can:</div><div>1) use &quot;save_cookies /some/path&quot; to save your already-loaded cookies to an existing (empty) file</div>
<div>2) append the new cookie to that file</div><div>3) use &quot;load_cookies /some/path&quot; to load all the cookies back into your jar</div><div><br></div><div>Of course, especially if the cookie you want to insert is static, you could set up your file with it initially, and see if Twill is nice enough to not overwrite it with save_cookies.</div>
<div><br></div><div>If you are doing this entirely in twill-sh, though, you&#39;re operating outside of what I&#39;m really familiar with, and there might be some parts you&#39;ll have to do in Python (with the &quot;run&quot; command -- e.g. step 2).</div>
<div><br></div><div>Good luck,</div><div>Jesse</div><div><br><br><div class="gmail_quote">On Tue, May 12, 2009 at 6:06 PM, Norman Khine <span dir="ltr">&lt;<a href="mailto:norman@khine.net">norman@khine.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
I have the latest twill setup and all works well, but have a question<br>
concerning cookies.<br>
On a page, I would like to insert a specific cookie, and at the same<br>
time keep the cookies that are already loaded. Is there a way to do<br>
this?<br>
For example, the cookie I want to set is:<br>
<br>
Set-Cookie3: tmain_referrer=&quot;<a href="http://localhost/index.php" target="_blank">http://localhost/index.php</a>&quot; path=&quot;/&quot;;<br>
domain=&quot;localhost&quot;; path_spec; discard; version=0<br>
<br>
Thanks<br>
Norman<br>
<br>
_______________________________________________<br>
twill mailing list<br>
<a href="mailto:twill@lists.idyll.org">twill@lists.idyll.org</a><br>
<a href="http://lists.idyll.org/listinfo/twill" target="_blank">http://lists.idyll.org/listinfo/twill</a><br>
</blockquote></div><br></div>