Unable to set cookie with Fapws3-0.2 not Set-Cookie headers send :(

11 views
Skip to first unread message

sector119

unread,
Mar 14, 2009, 6:57:15 AM3/14/09
to Fast Asynchronous Python Web Server
Hi All!

I have a problem when I run my wsgi app (using pylons 0.9.7) with
Fapws3-0.2 I can't set cookie, not Set-Cookie headers send with
response, with paste server everything works fine!

My controllers/test.py:

from pylons import request, response
from pylons.controllers.util import redirect_to
from eps.lib.base import BaseController

class TestController(BaseController):
def setcookie(self):
response.set_cookie('test', 'test', max_age=10000, path='/')
return redirect_to('/')

I run app with:
% cat run.py
import sys
import paste.deploy
import fapws._evwsgi as evwsgi
from fapws import base

sys.setcheckinterval = 100000 # since we don't use threads, internal
checks are no more required

conf = {}

def main():
if len(sys.argv) != 4:
sys.exit('Usage: python run.py host:port section config')
global conf
(conf['host'], conf['port']) = sys.argv[1].split(':')
app = paste.deploy.loadapp('config:%s#%s' % (sys.argv[3], sys.argv
[2]))
start(app)

def start(wsgi_app):
evwsgi.start(conf['host'], int(conf['port']))
evwsgi.set_base_module(base)

def app(environ, start_response):
environ['wsgi.multiprocess'] = False
return wsgi_app(environ, start_response)

evwsgi.wsgi_cb(('', app))
evwsgi.run()

if __name__=='__main__':
main()

Why it can be so? Thanks a lot!

william opensource4you

unread,
Mar 14, 2009, 3:47:26 PM3/14/09
to fa...@googlegroups.com
Hi,

Thanks to give a try to Fapws.

I don't know much about pylons ;-(.
I suppose that as I've done for Django, an adaptater must be written.

William

sector119

unread,
Mar 16, 2009, 4:22:33 AM3/16/09
to Fast Asynchronous Python Web Server
I thinks that it should work without any handlers if it's true wsgi
server, because pylons/loadapp (not like django) returns true wsgi
app :/
Why such adaptaters have to be written? What
start_response.cookies=res.cookies in contrib/django_handler.py mean?
http://www.python.org/dev/peps/pep-0333/ know _nothing_ about
start_response.cookies, start_response have no cookie attribute!?

Thanks!

william opensource4you

unread,
Mar 16, 2009, 12:02:04 PM3/16/09
to fa...@googlegroups.com
To my understanding of WSGI, cookies are not included.
This let different interpretation on how to deal with it.

If you can help and point me the way we must manage cookies in a WSGI
way, I'm interested.

Reply all
Reply to author
Forward
0 new messages