<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Django foo &#187; session</title>
	<atom:link href="http://www.djangofoo.com/tag/session/feed" rel="self" type="application/rss+xml" />
	<link>http://www.djangofoo.com</link>
	<description>Django Tips and Tweaks</description>
	<lastBuildDate>Wed, 18 Aug 2010 09:38:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Session Key Change On Login</title>
		<link>http://www.djangofoo.com/330/session-key-change-on-login</link>
		<comments>http://www.djangofoo.com/330/session-key-change-on-login#comments</comments>
		<pubDate>Sat, 03 Jul 2010 21:05:43 +0000</pubDate>
		<dc:creator>Arif Harbott</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[sessionkey]]></category>

		<guid isPermaLink="false">http://www.djangofoo.com/?p=330</guid>
		<description><![CDATA[If you use the request.session.session_key for an anonymous user e.g. to store shopping cart information, and then use django.contrib.auth login be aware that the session key will change. This tends to catch out new Django developers.]]></description>
			<content:encoded><![CDATA[<p>If you use the <strong>request.session.session_key</strong> for an anonymous user e.g. to store shopping cart information, and then use <strong>django.contrib.auth login</strong> be aware that the session key will change. This tends to catch out new Django developers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.djangofoo.com/330/session-key-change-on-login/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Session array/list append does not work</title>
		<link>http://www.djangofoo.com/57/session-arraylist-append-does-not-work</link>
		<comments>http://www.djangofoo.com/57/session-arraylist-append-does-not-work#comments</comments>
		<pubDate>Mon, 01 Feb 2010 20:19:52 +0000</pubDate>
		<dc:creator>Davo</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[append]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[session]]></category>

		<guid isPermaLink="false">http://www.djangofoo.com/?p=57</guid>
		<description><![CDATA[I was trying to save and update some arrays inside the Django session object but it was not working at all&#8230; The following snippet DOES NOT WORK request.session['array'] = [] # let's create an empty array # try to append some integers... request.session['array'].append(1) request.session['array'].append(2) request.session['array'].append(3) ... In order to solve this we need to store [...]]]></description>
			<content:encoded><![CDATA[<p>I was trying to save and update some arrays inside the Django <strong>session</strong> object but it was not working at all&#8230;</p>
<p>The following snippet <strong>DOES NOT WORK</strong></p>
<pre class="brush: python">
request.session['array'] = [] # let's create an empty array
# try to append some integers...
request.session['array'].append(1)
request.session['array'].append(2)
request.session['array'].append(3)
...
</pre>
<p>In order to solve this we need to store the array in a temporary object first.<br />
Quick fix:</p>
<pre class="brush: python">
request.session['array'] = []
tmp = request.session['array']
tmp.append(1)
tmp.append(2)
tmp.append(3)
request.session['array'] = tmp # this works now.
...
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.djangofoo.com/57/session-arraylist-append-does-not-work/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

