gae-sessions

How to get current session with only the SID?

↘锁芯ラ 提交于 2020-01-02 14:39:13
问题 How can I retrieve a session using only its session identifier (SID)? I'm using gae-sessions. Update for response @David Underhill: I've done what you suggested, but in debug mode I got this: Session: SID=None {} | but it has db_key populated with a string. Here is my code: upload.py SID = self.request.get("SID") if not SID: return False from app.models.user import User user = User.get_current_user(SID) user.py def get_current_user(SID = None): if SID: session = Session(sid=SID) else: session

How to get current session with only the SID?

醉酒当歌 提交于 2020-01-02 14:38:04
问题 How can I retrieve a session using only its session identifier (SID)? I'm using gae-sessions. Update for response @David Underhill: I've done what you suggested, but in debug mode I got this: Session: SID=None {} | but it has db_key populated with a string. Here is my code: upload.py SID = self.request.get("SID") if not SID: return False from app.models.user import User user = User.get_current_user(SID) user.py def get_current_user(SID = None): if SID: session = Session(sid=SID) else: session

gaesessions cant find 'current_session' attribute

蓝咒 提交于 2019-12-08 10:20:29
问题 I'm using gaesessions. When I try to check the current sessions by doing get_current_session() I get the following error: File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\webapp\_webapp25.py", line 716, in __call__ handler.post(*groups) File "C:\Users\roger\Documents\projects\myapp\handlers\unburden.py", line 502, in post session = get_current_session() File "C:\Users\roger\Documents\projects\myapp\gaesessions\__init__.py", line 37, in get_current_session return _tls

How to get current session with only the SID?

倖福魔咒の 提交于 2019-12-06 11:44:26
How can I retrieve a session using only its session identifier (SID)? I'm using gae-sessions . Update for response @David Underhill: I've done what you suggested, but in debug mode I got this: Session: SID=None {} | but it has db_key populated with a string. Here is my code: upload.py SID = self.request.get("SID") if not SID: return False from app.models.user import User user = User.get_current_user(SID) user.py def get_current_user(SID = None): if SID: session = Session(sid=SID) else: session = get_current_session() if session.has_key('account.logged'): return User.get(db.Key(session.get(