Skip to content

Commit

Permalink
Adding example using secure cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
puentesarrin authored and toastdriven committed Feb 27, 2013
1 parent 3c3d775 commit 35a37df
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions examples/http_secure_cookie_support.py
@@ -0,0 +1,16 @@
# -*- coding: utf-8 *-*
from itty import *

@get('/receive')
def receive_cookies(request):
response = Response(str(request.get_secure_cookie('foo')),
content_type='text/plain')
return response

@get('/send')
def response_cookies(request):
response = Response('Check your cookies.')
response.set_secure_cookie('foo', 'bar')
return response

run_itty(cookie_secret='MySeCrEtCoOkIe')

0 comments on commit 35a37df

Please sign in to comment.