--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/aRIVySTv6hE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To store sessions in cookies instead you can do:
session.connect(request,response,cookie_key='yoursecret',compression_level=None)
Here cookie_key
is a symmetric encryption key. compression_level
is an optional zlib
encryption level.
While sessions in cookie are often recommended for scalability reason they are limited in size. Large sessions will result in broken cookies.
This doesn't appear to be a problem coming from our platform. Any request coming into your app will have session cookies passed.
The way sessions stored on databases work is by setting a cookie with an id, and then looking for the session data related to that id.
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.
I checked into my browser's development tools to check cookies and found that indeed, there are two cookies : session_id_APPNAME and session_id_admin. These cookies and their values are persistent through requests, even with multiple dynos.
I now wonder about web2py's session management and especially regarding Auth : How exactly does it decide wether a user is an existing user or a new user ?
if request.env.web2py_runtime_gae:
session_db = DAL('gae')
session.connect(request, response, db=session_db)
hosts = (http_host, )
is_gae = True
else:
is_gae = False
if request.env.web2py_runtime_gae:
session_db = DAL('gae')
session.connect(request, response, db=session_db)
hosts = (http_host, )
is_gae = True
elif request.env.web2py_runtime_heroku:
session_db = ???
session.connect(request, response, db=session_db)
else:
is_gae = False
Le 26 nov. 2014 à 13:01, Leonel Câmara <leonel...@gmail.com> a écrit :
How will you get your db configuration in admin? I don't think it should have all these ifs and elifs specially for heroku when this isn't heroku specific, this is about how you can configure the admin to store cookies in the DB.Maybe just add an option in settings.cfg to configure the admin's session storage? Otherwise, I think people just modifying the admin model if they want that is ok too.
--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/aRIVySTv6hE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
I can’t find any documentation about settings.cfg.How does it work ? Where is it loaded ? Is it application-specific ?
from gluon.settings import global_settings
global_settings.db_sessions = True
request.tickets_db = db
The thing is : my disappointment here lies in the architecture, not the features.There is little contribution to be done when regarding an architectural issue (except a big refactoring of course, which you can't expect a regular contributor to do on his own).
I think it is fair to share personal experiences regarding the framework (good or bad), as long as they are relevant.
Same goes for appadmin.py and its permission-based "manage" feature which is described as a role-based database access. Why would you define roles in a local environment ? Obviously this is meant to go on production in a secure back-office...
Note, aside from adding a few lines in the admin app to have its sessions stored in the db, another option might be to edit the handler file used to start web2py. In that file, you should be able to do something like this:from gluon.settings import global_settings
global_settings.db_sessions = True
if request.env.web2py_runtime_gae:
session_db = DAL('gae')
session.connect(request, response, db=session_db)
Note, aside from adding a few lines in the admin app to have its sessions stored in the db, another option might be to edit the handler file used to start web2py. In that file, you should be able to do something like this:from gluon.settings import global_settings
global_settings.db_sessions = TrueThis does not work because db_sessions is only considered if response.session_storage_type == 'db' (i.e. if the db attribute is set in session.connect(...)).Admin uses the default session.connect(...) so it does not set a db to store sessions into. Global settings won't change that (sadly).
The reason for this is that the ephemeral system on Heroku can be reset randomly at any given time, so sending tickets through the bundled script would sometimes send "ticket missing" emails.
I'm not too familiar with Heroku, but according to the little documentation I have seen, the filesystem should persist until the dyno restarts or is shut down. Does it really just reset randomly?