<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Sinatra Cookie handling in 0.9.4</title>
	<atom:link href="http://www.gittr.com/index.php/archive/sinatra-cookie-handling-in-0-9-4/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gittr.com/index.php/archive/sinatra-cookie-handling-in-0-9-4/</link>
	<description>eval("eval(\"eval(\\\"puts 'a ruby weblog'\\\")\")")</description>
	<lastBuildDate>Mon, 30 Aug 2010 18:42:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Bruce</title>
		<link>http://www.gittr.com/index.php/archive/sinatra-cookie-handling-in-0-9-4/comment-page-1/#comment-335</link>
		<dc:creator>Bruce</dc:creator>
		<pubDate>Wed, 19 May 2010 15:53:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.gittr.com/?p=109#comment-335</guid>
		<description>I think the Sinatra doc should be updated on changing `set_cookie` to `request.set_cookie`</description>
		<content:encoded><![CDATA[<p>I think the Sinatra doc should be updated on changing `set_cookie` to&nbsp;`request.set_cookie`</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Prew</title>
		<link>http://www.gittr.com/index.php/archive/sinatra-cookie-handling-in-0-9-4/comment-page-1/#comment-331</link>
		<dc:creator>Ben Prew</dc:creator>
		<pubDate>Mon, 03 May 2010 04:03:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.gittr.com/?p=109#comment-331</guid>
		<description>Regarding testing, I had some issues with setting a value in the session and then testing it was set correctly.  I did some digging and ended up faking the session.  There&#039;s an example on my posterous page:

http://blog.verastreet.com</description>
		<content:encoded><![CDATA[<p>Regarding testing, I had some issues with setting a value in the session and then testing it was set correctly.  I did some digging and ended up faking the session.  There&#8217;s an example on my posterous&nbsp;page:</p>
<p><a href="http://blog.verastreet.com" rel="nofollow">http://blog.verastreet.com</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Larry Siden</title>
		<link>http://www.gittr.com/index.php/archive/sinatra-cookie-handling-in-0-9-4/comment-page-1/#comment-320</link>
		<dc:creator>Larry Siden</dc:creator>
		<pubDate>Mon, 15 Mar 2010 02:02:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.gittr.com/?p=109#comment-320</guid>
		<description>I&#039;m testing with Cucumber a Sinatra app that sets a cookie.  How do I check that the cookie has been set?

I tried this:

get &quot;http://localhost:4567/logon/fake&quot;
@session_id = rack_mock_session.cookie_jar[&#039;alc_session_id&#039;]
@session_id.should_not be_nil

but it fails.

Here&#039;s a dump of the cookie-jar:
#&lt;Rack::Test::CookieJar:0xb9e08ec @default_host=&quot;example.org&quot;, @cookies=[#&quot;/&quot;, &quot;domain&quot;=&gt;&quot;localhost&quot;}&gt;]&gt;

I think it has something to do with the path, but the &#039;[]&#039; method selects all the cookies that match a nil path.  I&#039;m guessing that I have to set the domain and path somewhere in the test setup, but I can&#039;t figure out where.

By the way, cookies work fine in the real (non-test) app!  I just can&#039;t get them to work in Rack/Test.  Here&#039;s the code in case you want to take a look: http://github.com/lsiden/alc.datasource
I&#039;ll make it temporarily public.</description>
		<content:encoded><![CDATA[<p>I&#8217;m testing with Cucumber a Sinatra app that sets a cookie.  How do I check that the cookie has been&nbsp;set?</p>
<p>I tried&nbsp;this:</p>
<p>get &#8220;http://localhost:4567/logon/fake&#8221;<br />
@session_id = rack_mock_session.cookie_jar[&#8216;alc_session_id&#8217;]<br />
@session_id.should_not&nbsp;be_nil</p>
<p>but it&nbsp;fails.</p>
<p>Here&#8217;s a dump of the cookie-jar:<br />
#&lt;Rack::Test::CookieJar:0xb9e08ec @default_host=&quot;example.org&quot;, @cookies=[#&#8221;/&#8221;,&nbsp;&#8220;domain&#8221;=&gt;&#8221;localhost&#8221;}&gt;]&gt;</p>
<p>I think it has something to do with the path, but the &#8216;[]&#8217; method selects all the cookies that match a nil path.  I&#8217;m guessing that I have to set the domain and path somewhere in the test setup, but I can&#8217;t figure out&nbsp;where.</p>
<p>By the way, cookies work fine in the real (non-test) app!  I just can&#8217;t get them to work in Rack/Test.  Here&#8217;s the code in case you want to take a look: <a href="http://github.com/lsiden/alc.datasource" rel="nofollow">http://github.com/lsiden/alc.datasource</a><br />
I&#8217;ll make it temporarily&nbsp;public.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Juvenn Woo</title>
		<link>http://www.gittr.com/index.php/archive/sinatra-cookie-handling-in-0-9-4/comment-page-1/#comment-292</link>
		<dc:creator>Juvenn Woo</dc:creator>
		<pubDate>Thu, 22 Oct 2009 09:09:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.gittr.com/?p=109#comment-292</guid>
		<description>Hi, Chris. There&#039;s a typo: `request.set_cookie` should be `response.set_cookie`</description>
		<content:encoded><![CDATA[<p>Hi, Chris. There&#8217;s a typo: `request.set_cookie` should be&nbsp;`response.set_cookie`</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Juvenn Woo</title>
		<link>http://www.gittr.com/index.php/archive/sinatra-cookie-handling-in-0-9-4/comment-page-1/#comment-291</link>
		<dc:creator>Juvenn Woo</dc:creator>
		<pubDate>Thu, 22 Oct 2009 08:26:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.gittr.com/?p=109#comment-291</guid>
		<description>I think the Sinatra doc should be updated on changing `set_cookie` to `request.set_cookie`</description>
		<content:encoded><![CDATA[<p>I think the Sinatra doc should be updated on changing `set_cookie` to&nbsp;`request.set_cookie`</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: koops</title>
		<link>http://www.gittr.com/index.php/archive/sinatra-cookie-handling-in-0-9-4/comment-page-1/#comment-241</link>
		<dc:creator>koops</dc:creator>
		<pubDate>Fri, 25 Sep 2009 16:25:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.gittr.com/?p=109#comment-241</guid>
		<description>You mean &quot;response&quot; in the first two snippets...</description>
		<content:encoded><![CDATA[<p>You mean &#8220;response&#8221; in the first two&nbsp;snippets&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
