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.
Graham