Can I simulate multiple user logins to web2py from a single computer?

116 views
Skip to first unread message

Rufus

unread,
May 4, 2014, 7:35:56 PM5/4/14
to web...@googlegroups.com
Web2py'ers:

I am trying to create a back end for a multiple user game, including, for instance, a chat room function.
However, when I try to do this locally, all windows change over to the "most recent" login.

That is to say, I open up another window to the app, sign in with a different user id, and type.into
the chat app, and get the new message.  But if I go to one of the other "formerly signed in" windows
and try to chat, it submits as most recently logged in user.

Can I have multiple sessions/log ins from a single computer?

This may be a security issue, but would be useful for testing if it could be overridden, even temporarily.

Rufus

Anthony

unread,
May 4, 2014, 10:47:46 PM5/4/14
to web...@googlegroups.com
In Chrome, you can go to Settings, and in the Users section add multiple users to create different profiles. I think in that case each profile will get different browser session and therefore different session cookies, so you can maintain separate logins. For Firefox, there is https://addons.mozilla.org/en-US/firefox/addon/cookieswap/.

Anthony

Robert Kooij

unread,
May 5, 2014, 2:19:30 AM5/5/14
to web...@googlegroups.com
Or if you want to keep it even simpler, just use multiple (different) browsers, each browser keep track of their own session. 

I assume, as a web developer you have Chrome, Firefox and Safari installed anyway? Should be able to simulate 3 different user to start with. :)

Rufus Smith

unread,
May 5, 2014, 11:14:45 AM5/5/14
to web...@googlegroups.com
Hi Robert,

I noticed that!  I fired up Chrome, and it started a different session.   Haven't tried with IE, and until now haven't worked with Safari on my desktop. (but on my iphone, yeah).  As the project gets closer to a beta stage,  I'll look at compatibility...

Rufus
--
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/kT6TxT3XSzo/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.

黄祥

unread,
May 5, 2014, 4:17:05 PM5/5/14
to web...@googlegroups.com
web2py itself have an impersonate function, not sure is it suitable in your case or not.
e.g.
# user
db.auth_user.bulk_insert([{"first_name" : "Admin", "last_name" : "Admin",
                           "email" : "ad...@a.com", "username" : "admin",
                           "password" : db.auth_user.password.validate("password")[0] },
                          {"first_name" : "User", "last_name" : "User",
                           "email" : "us...@a.com", "username" : "user",
                           "password" : db.auth_user.password.validate("password")[0] } ] )

# permission (admin impersonate user)
auth.add_permission(1, "impersonate", "auth_user", 2)

after that please access, default/user/impersonate

best regards,
stifan
Reply all
Reply to author
Forward
0 new messages