-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attach to existing session #17
Comments
Hi! Other option is entablish a new connection in background and fetch last messages from server (like gmail does) |
Hi, Setting a new connection would also not be a bad idea, but you are asking for the username and password in the new tab as well, right? How do we bypass that? |
Sync two "sessions" will cause you a lot of headache since the plugin will do request every 60 seconds (or the defined wait time) and on every request you should "sync" all tabs. To set a new connection I usually generates a token that is saved into a cookie. The most easy way is save the encrypted password (wich is a step in md5-digest login) and the use it directly in a custom login method. A better way is configure your server to allow custom tokens. This is when you login, you receive a token wich authenticates the user (with a expiration time). Then save it in a cookie and make a custon login method. |
@maxpowel can you elaborate more on your approach? |
Let's assume that I open the chat application in one tab and login and connect. I am now connected and able to chat. Now, I will open the same chat page in another tab of the same browser - Naturally I expect to stay connected and continue chatting from the new tab as well.
I am not sure of how to proceed to achieve this. I assumed that the 'attach' function should be used for this. If yes, then I did try that. What I did was, in the first tab, whatever jid, sid and rid were found, were passed to the attach function in the second tab as well. However, I got some error (post error). Am I doing something wrong? How do we achieve this?
The text was updated successfully, but these errors were encountered: