<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom"><title>Simon Willison's Weblog: messages</title><link href="http://simonwillison.net/" rel="alternate"/><link href="http://simonwillison.net/tags/messages.atom" rel="self"/><id>http://simonwillison.net/</id><updated>2009-06-19T21:57:36+00:00</updated><author><name>Simon Willison</name></author><entry><title>Towards a Standard for Django Session Messages</title><link href="https://simonwillison.net/2009/Jun/19/caktus/#atom-tag" rel="alternate"/><published>2009-06-19T21:57:36+00:00</published><updated>2009-06-19T21:57:36+00:00</updated><id>https://simonwillison.net/2009/Jun/19/caktus/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.caktusgroup.com/blog/2009/06/19/towards-a-standard-for-django-session-messages/#comment-219"&gt;Towards a Standard for Django Session Messages&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
I completely agree that Django’s user.message_set (which I helped design) is unfit for purpose, but I don’t think sessions are the right solution for messages sent to users. A signed cookie containing either the full message or a key referencing the message body on the server is a much more generally useful solution as it avoids the need for a round trip to a persistent store entirely.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/cookies"&gt;cookies&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/django"&gt;django&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/flash"&gt;flash&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/messages"&gt;messages&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/sessions"&gt;sessions&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/signedcookies"&gt;signedcookies&lt;/a&gt;&lt;/p&gt;



</summary><category term="cookies"/><category term="django"/><category term="flash"/><category term="messages"/><category term="python"/><category term="sessions"/><category term="signedcookies"/></entry></feed>