Hi All,
i would like to remove sessions for some selected users.
I can't find a way to relate a session to a user, is there a way to do this?
I already store the sessions in the database, so removing all sessions is
easy:
@auth.requires_membership('Administrators')
def invalidate_sessions():
sessions = db(db.web2py_session_Charon.id>0).select(db.
web2py_session_Charon.ALL)
for sessie in sessies:
db(db.web2py_session_Charon.id==sessie.id).delete()
...
But i cannot find how to delete only sessions which belong to a particular
user.
I can see that the session.data contains all sorts of fields but cannot
figure out how to use this to find the corresponding user.id
Does anybody have a hint in the right direction?
Thanks in advance!
Jaap
--