diff -r 00e5cb9771c5 -r 79ce84750c18 pyramid_cubicweb/login.py --- a/pyramid_cubicweb/login.py Mon Aug 04 13:04:19 2014 +0200 +++ b/pyramid_cubicweb/login.py Mon Aug 04 13:06:32 2014 +0200 @@ -26,11 +26,12 @@ if user_eid is not None: headers = security.remember(request, user_eid) - raise HTTPSeeOther( - request.params.get('postlogin_path', '/'), - headers=headers) + new_path = request.params.get('postlogin_path', '/') - response.headerlist.extend(headers) + if new_path == 'login': + new_path = '/' + + raise HTTPSeeOther(new_path, headers=headers) response.text = render_view(request, 'login') return response