Problems with Cookie

2 views
Skip to first unread message

Евгений Негрий

unread,
Feb 8, 2012, 12:25:29 AM2/8/12
to modwsgi
I create SimpleCookie from module Cookie. I add SimpleCookie.output()
in os.environ. I do print os.environ and I see my cookie, but when I
go in other page and I do print os.environ too, I don`t found my
cookie!

Graham Dumpleton

unread,
Feb 8, 2012, 2:53:51 AM2/8/12
to mod...@googlegroups.com

When writing WSGI applications you never deal with os.environ. Cookies
are read from 'environ' argument to application and written to
response headers passed to start_response().

What I strongly recommend you do, instead of starting at the WSGI
level, is to use a WSGI micro framework such as Flask. It has builtin
functionality which does all the hard work of dealing with cookies and
lots of other stuff which is fiddly if you do it yourself.

http://flask.pocoo.org

Graham

Reply all
Reply to author
Forward
0 new messages