title: Testing a session variable
body: <p>I came across Django <code>request.session</code>; I know how to set and test it for a <strong>specific</strong> value.</p>
  <pre><code>request.session['name'] = &quot;dummy&quot;
  </code></pre>
  <p>and somewhere I check</p>
  <pre><code>if request.session['name'] == &quot;dummy&quot; :
     #do something
  </code></pre>
  <p>But, now I have to check whether the session variable was even set in the first place? I mean how can I check whether there exists a value in the <code>request.session['name']</code> is set?</p>
  <p>Is there a way to check it?</p>