-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Restore session #2
Comments
I've done, but restore isn't working headless, waitforselector never get resolved Clone my repo https://github.com/jovazxc/whatsapp-web.js/ and try the following First npm install
|
Thanks for the input! The main issue here with using localStorage is that there's something in WhatsApp Web's code that prevents us from going to the application more than once while in headless mode. Just doing a simple refresh on the page won't let you get in, showing you the following error: This means that we would need to apply the tokens to localStorage using some other method. I was able to do this using puppeteer's To restore the session just pass a "session" parameter to the options object like so:
The
|
I have a question here, how long can we stay in one session? My client have responded during the 2 days and then there was 'Client was logged out' @jovazxc @pedroslopez |
I'm not entirely sure, to be honest... However, make sure you don't log in to WhatsApp Web for that number on another app or browser as that will log it out. If connection to the phone is lost, this will also trigger a disconnect event. Ideally this case should be a bit more resilient so if it is indeed because connection was temporarily lost, then it should recognize when it's back online instead of just emitting the disconnect event and closing the client. |
Hello, How to store session and use it? I had put on session.json like this : and this my scan code :
It doesn't work, is there something wrong on my code? please help me, thanks. |
Hi @gunomnifluencer, you're not saving the session info on successful login. Specifically, you're missing the For more info, please read https://waguide.pedroslopez.me/features/resuming-sessions |
how to check if the client is logged in successfully? I follow the https://waguide.pedroslopez.me/features/resuming-sessions, but it does not trigger the 'authenticated'. |
…/patch Update WhatsApp Web Version (2.2236.10)
how to delete the whatsapp-web.js localAuth session if the user unlinks the device from phone and start a new session? @pedroslopez |
(node:1496) DeprecationWarning: options.session is deprecated and will be removed in a future release due to incompatibility with multi-device. Use the LocalAuth authStrategy, don't pass in a session as an option, or suppress this warning by using the LegacySessionAuth strategy explicitly (see https://wwebjs.dev/guide/authentication.html#legacysessionauth-strategy). |
Revert version info of auto update: "Update WhatsApp Web Version (2.2321.6)"
I'm trying to restore the WhatsApp Session, I found that most of data is saved in the localStorage and a little part is on cookies
I obtained the cookies using the dev tools functions because there are HttpOnly, and it can't be obtained through normal methods
But I'm unable to apply them, I'd tried with
But isn't working
The text was updated successfully, but these errors were encountered: