How to change another user's session vars?

23 views
Skip to first unread message

Alex Glaros

unread,
Sep 27, 2016, 5:24:46 PM9/27/16
to web...@googlegroups.com
In a social network, I keep who_has_blocked_me in session vars so that their people searches don't display people that have blocked me.

However if the blocked person is logged on at same time that blocker person blocks them, the blocked person's session vars will not be current.

Is there a way to detect if someone else besides current user is logged on and change their session vars in this type of situation?  Or do I have to wait until they log on again to re-populate with updated session vars?

Otherwise, I have to check the blocked_people table every time there's a people search.

thanks

Alex Glaros

Alex Glaros

unread,
Sep 27, 2016, 5:36:47 PM9/27/16
to web...@googlegroups.com
it would be acceptable to force logout blocked user so they have to login again.  

wait... this wouldn't work because user could force logout many people by "blocking" them

Dave S

unread,
Sep 27, 2016, 6:53:16 PM9/27/16
to web2py-users

How about in the people table, you add a field for "blockingHasChanged".  If that is true, the people search routine goes to check the blocked_people table and discards the row if that entry shows the searcher is blocked, otherwise the row is kept.

  if row.blockingHasChanged:
   
if (check_blocked_people == ME):
      rows
.delete(row)
  display_people
(row)


 

thanks

Alex Glaros


/dps

Alex Glaros

unread,
Sep 27, 2016, 7:13:59 PM9/27/16
to web2py-users
thanks Dave, I think somthing like that is the best way.
Reply all
Reply to author
Forward
0 new messages