I scheduled cron to regularly trash the session in my web2py applications.
this worked well
until I added this line of code to a model.py file;
response.cookies[response.session_id_name]['domain'] = '.leonexus.nl'
My scripts log any errors at ~my/logs/user/sessions2trash.log.
That file is full of lines like:
Traceback (most recent call last):
File "/home/my/webapps/web2py/web2py/gluon/restricted.py", line 227, in
restricted
exec ccode in environment
File "applications/init/models/00_init_db.py", line 6, in <module>
response.cookies[response.session_id_name]['domain'] = '.mydomain.com'
KeyError: None
I know in python a KeyError is raised when a dictionary is accessed but the
key requested is not in it.
However, I have no idea why the line of code interferes with calling
/scripts/sessions2trash.py
I am working with web2py 2.14.5 and python 2.7
Hope someone can help me solve the issue.
Kind regards,
Annet
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/web2py/ca03bcf7-2e00-4aee-a645-8ea01fd90f3b%40googlegroups.com.