[web] on logout, use the base_url argument of build_url instead of hacking the request to get proper url. This fix a bug on site with http/https versions: the session cookie is badly removed on logout stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 09 Apr 2010 15:08:24 +0200
branchstable
changeset 5200 2b454c6ab7ef
parent 5199 ebb50479d2ab
child 5201 2b4267157f85
child 5203 0b26a941410f
[web] on logout, use the base_url argument of build_url instead of hacking the request to get proper url. This fix a bug on site with http/https versions: the session cookie is badly removed on logout
web/views/basecontrollers.py
--- a/web/views/basecontrollers.py	Fri Apr 09 15:07:01 2010 +0200
+++ b/web/views/basecontrollers.py	Fri Apr 09 15:08:24 2010 +0200
@@ -91,11 +91,11 @@
         #   anonymous connection is allowed and the page will be displayed or
         #   we'll be redirected to the login form
         msg = self._cw._('you have been logged out')
-        if self._cw.https:
-            # XXX hack to generate an url on the http version of the site
-            self._cw._base_url =  self._cw.vreg.config['base-url']
-            self._cw.https = False
-        return self._cw.build_url('view', vid='index', __message=msg)
+        # force base_url so on dual http/https configuration, we generate an url
+        # on the http version of the site
+        return self._cw.build_url('view', vid='index', __message=msg,
+                                  base_url=self._cw.vreg.config['base-url'])
+
 
 class ViewController(Controller):
     """standard entry point :