Hi ,
I am using web2py 2.5.1-stable+timestamp.2013.06.06.15.39.19 in my
production environment. I know it is old but thinking about the mysql and
other folders and files structure changes I am little hesitant to update
it. My problem is this.
My logout function doesn't work properly.
# Login function
def login():
try:
logger.debug("login page")
form = auth.login()
return dict(form = form)
except Exception,e:
logger.error(traceback.format_exc())
redirect(URL(errorpage))
@auth.requires_login()
def index():
try:
if auth.has_membership('root'):
logger.debug(auth.user.first_name + ": logged in")
redirect(URL('default', 'usrMgr'))
else:
logger.debug(auth.user.first_name +": logged in")
redirect(URL('dashboard'))
except Exception,e:
logger.error(traceback.format_exc())
redirect(URL(errorpage))
@auth.requires_login()
@auth.requires_permission(request.function)
def dashboard():
try:
logger.info("dashboard")
###Some Code#######
except Exception,e:
logger.error(traceback.format_exc())
redirect(URL(errorpage))
def logout():
try:
logger.debug("logout")
auth.logout(next=URL(r=request, c='default', f='login'))
return dict()
except Exception,e:
logger.error(traceback.format_exc())
redirect(URL(errorpage))
The behavior is different in different browsers. In Chrome when I select
logout from the dashboard page, it remains in the same page. When I select
the developer tools and check the network the urls are logout, login,
dashboard in order and its loaded from cache. But there is no problem in
firefox.
My problem is the logut function doesnt redirect to login page. When I
clear the browser cache or delete all the sessions in the sessions folder,
it works neatly. But when the session file or the cache gets filled up,
everything goes wrong. Let me know if I wasn't specific, so I can clear
this problem.
Thanks and Regards,
Ajith
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.