Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding example using secure cookies

  • Loading branch information...
commit 35a37df952f12e0fcb4a67e486574ee083fd7993 1 parent 3c3d775
@puentesarrin puentesarrin authored committed
Showing with 16 additions and 0 deletions.
  1. +16 −0 examples/http_secure_cookie_support.py
View
16 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')
Please sign in to comment.
Something went wrong with that request. Please try again.