How Django sessions work – introduction

June 24th, 2011 at 12:50 pm

While working on a private web application earlier this week, I ran into Django’s session support for the first time. Like many other aspects of web app development, Django can make dealing with sessions very easy, although sessions are a complex topic – adding state on top of the stateless HTTP protocol isn’t trivial.

As happens sometimes, my curiosity was triggered and I decided to understand how Django achieves this "magic" – seamlessly implementing sessions while facing the user with a very simple-to-use API, hiding the complexity underneath. And reusing my well-chewed maxim – the best way to learn is to teach. Hence, this series of articles.

Related posts:

  1. Django sessions – part II: How sessions work
  2. Django sessions – part III: User authentication
  3. Django sessions – part I: Cookies
  4. Porting from Turbogears to Django – a personal experience
  5. A simple canvas-based Javascript game, with a Django back-end

8 Responses to “How Django sessions work – introduction”

  1. grillermoNo Gravatar Says:

    Patiently waiting for the next article, i liked the cookies explanation. I didn’t got it all but seems easy enough.

  2. marwyNo Gravatar Says:

    Wonderfull idea. Can’t wait to see the next one.

  3. AndresNo Gravatar Says:

    Great article! Have you explored modding session configs? Any interesting approaches?

  4. elibenNo Gravatar Says:

    Andres, Not sure I understand what you mean by “modding session configs”?

  5. CamilleNo Gravatar Says:

    Thanks for this great series of articles !

  6. CyrilNo Gravatar Says:

    Thanks a lot for that awesome explanation!

  7. jaiNo Gravatar Says:

    hey thanks sir i have spent lots of time on searching the idea on session……………
    but becz of ur blog on session i finished me homework…..

    i thanks to u

    hope u blog lot of things on django….

    with regard
    jai

  8. HHHNo Gravatar Says:

    Thanks man.. Really appreciate your way of explaining.

Leave a Reply

To post code with preserved formatting, enclose it in `backticks` (even multiple lines)