<?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>
	「CSRF（Cross-site request forgery）以及django中的处理方法」的评论	</title>
	<atom:link href="https://haoluobo.com/2012/07/csrf-django/feed/" rel="self" type="application/rss+xml" />
	<link>https://haoluobo.com/2012/07/csrf-django/</link>
	<description>to be continue....</description>
	<lastBuildDate>Fri, 27 Jul 2012 17:04:50 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>
	<item>
		<title>
		评论者：donyang		</title>
		<link>https://haoluobo.com/2012/07/csrf-django/#comment-250</link>

		<dc:creator><![CDATA[donyang]]></dc:creator>
		<pubDate>Fri, 27 Jul 2012 17:04:50 +0000</pubDate>
		<guid isPermaLink="false">/?p=10608#comment-250</guid>

					<description><![CDATA[看完这篇文章让我想起了那句话：大师通常是能把复杂的事情说的简单明了的]]></description>
			<content:encoded><![CDATA[<p>看完这篇文章让我想起了那句话：大师通常是能把复杂的事情说的简单明了的</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		评论者：岭南六少		</title>
		<link>https://haoluobo.com/2012/07/csrf-django/#comment-249</link>

		<dc:creator><![CDATA[岭南六少]]></dc:creator>
		<pubDate>Thu, 19 Jul 2012 14:30:07 +0000</pubDate>
		<guid isPermaLink="false">/?p=10608#comment-249</guid>

					<description><![CDATA[非常感觉回复
我试试看先]]></description>
			<content:encoded><![CDATA[<p>非常感觉回复<br />
我试试看先</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		评论者：vicalloy		</title>
		<link>https://haoluobo.com/2012/07/csrf-django/#comment-248</link>

		<dc:creator><![CDATA[vicalloy]]></dc:creator>
		<pubDate>Thu, 19 Jul 2012 13:14:54 +0000</pubDate>
		<guid isPermaLink="false">/?p=10608#comment-248</guid>

					<description><![CDATA[回复给 &lt;a href=&quot;https://haoluobo.com/2012/07/csrf-django/#comment-247&quot;&gt;岭南六少&lt;/a&gt;。

应当是django没有设置csrf的cookie。你可以在views前进加ensure_csrf_cookie强制django进行csrf cookie的设置。参考文档 https://docs.djangoproject.com/en/1.4/ref/contrib/csrf/#edge-cases
不需要用户登陆的请求应当是不存在csrf问题的，所以对非登陆的AJAX请求你可以加个
https://docs.djangoproject.com/en/1.4/ref/contrib/csrf/#django.views.decorators.csrf.csrf_exempt
你在用户的登陆函数前加个ensure_csrf_cookie，确保用户登陆后csrf cookie正确设置，需要登录的ajax请求也就没问题了。]]></description>
			<content:encoded><![CDATA[<p>回复给 <a href="https://haoluobo.com/2012/07/csrf-django/#comment-247">岭南六少</a>。</p>
<p>应当是django没有设置csrf的cookie。你可以在views前进加ensure_csrf_cookie强制django进行csrf cookie的设置。参考文档 <a href="https://docs.djangoproject.com/en/1.4/ref/contrib/csrf/#edge-cases" rel="nofollow ugc">https://docs.djangoproject.com/en/1.4/ref/contrib/csrf/#edge-cases</a><br />
不需要用户登陆的请求应当是不存在csrf问题的，所以对非登陆的AJAX请求你可以加个<br />
<a href="https://docs.djangoproject.com/en/1.4/ref/contrib/csrf/#django.views.decorators.csrf.csrf_exempt" rel="nofollow ugc">https://docs.djangoproject.com/en/1.4/ref/contrib/csrf/#django.views.decorators.csrf.csrf_exempt</a><br />
你在用户的登陆函数前加个ensure_csrf_cookie，确保用户登陆后csrf cookie正确设置，需要登录的ajax请求也就没问题了。</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		评论者：岭南六少		</title>
		<link>https://haoluobo.com/2012/07/csrf-django/#comment-247</link>

		<dc:creator><![CDATA[岭南六少]]></dc:creator>
		<pubDate>Thu, 19 Jul 2012 09:10:32 +0000</pubDate>
		<guid isPermaLink="false">/?p=10608#comment-247</guid>

					<description><![CDATA[在ajax 使用csrf感觉蛮麻烦的
这几天整合django + DWZJs（一个jquery UI框架）
根据官方文档使用js那段代码
结果chrome下面没有问题
ie和firefox下cookies值总是为空，老是报403错误
请教博主，有没有什么解决思路呢？亦或是否遇到过ie下csrf报403错误的问题]]></description>
			<content:encoded><![CDATA[<p>在ajax 使用csrf感觉蛮麻烦的<br />
这几天整合django + DWZJs（一个jquery UI框架）<br />
根据官方文档使用js那段代码<br />
结果chrome下面没有问题<br />
ie和firefox下cookies值总是为空，老是报403错误<br />
请教博主，有没有什么解决思路呢？亦或是否遇到过ie下csrf报403错误的问题</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		评论者：falcon		</title>
		<link>https://haoluobo.com/2012/07/csrf-django/#comment-246</link>

		<dc:creator><![CDATA[falcon]]></dc:creator>
		<pubDate>Wed, 18 Jul 2012 22:45:18 +0000</pubDate>
		<guid isPermaLink="false">/?p=10608#comment-246</guid>

					<description><![CDATA[用这么简洁的文字就能把CSRF说清楚，厉害。]]></description>
			<content:encoded><![CDATA[<p>用这么简洁的文字就能把CSRF说清楚，厉害。</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		评论者：xaingxiadage		</title>
		<link>https://haoluobo.com/2012/07/csrf-django/#comment-245</link>

		<dc:creator><![CDATA[xaingxiadage]]></dc:creator>
		<pubDate>Mon, 16 Jul 2012 13:36:10 +0000</pubDate>
		<guid isPermaLink="false">/?p=10608#comment-245</guid>

					<description><![CDATA[不错。学习了！]]></description>
			<content:encoded><![CDATA[<p>不错。学习了！</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
