Hey all, I'm making a bot and trying to use the LocalAuth method to make the session persistent throughout reboots. I can scan the QR just fine and get logged in, and I can see the dotfiles for the session folders being stored, but after restarting the script, I get a QR prompt again. I'm not sure about what I'm doing wrong, and although I've already seen some GH issues that talk about the same without having an answer, I figured out this server would be a shot worth trying.
#LocalAuth doesn't persist
25 messages · Page 1 of 1 (latest)
Check if the folder has the full rights
It seems normal, but it's strange doesn't work
Try
const client = new Client({
authStrategy: new LocalAuth(),
puppeteer: {
headless: false
}
});
well, a chrome app just opened. luckily, persistence does work now
still, not very convenient to have it not be headless
tried setting headless to true after that, interesting
oh interesting
after deleting the wwebjs cache folder, it now works while being headless
that's great, although it does seem a bit of a hacky solution. wondering it it'll persist like that once I move to an actually headless server
nonetheless, thanks for the fix. i'll still keep the ticket open to add room for improvement
I think the browser is necessary to persist a session, if you don't use it you won't be able to save a session
that's so weird, would that count like a puppeteer issue?
No, it's not weird, only a browser can use a session
The lib pretends to be like a human using WhatsApp Web, and you will need a browser to use some functionalities
You can try headless true, the browser will run without a graphical interface
yep! that's what I did. thanks!
I'm facing the same problem here. 😦
I've already deleted the cache files and get the QR code again, but after some hours the bot leave the session and I had to get the QR again.
Oh, no idea about prolonged sessions. Mine was just dying upon restarts
I that issue is not directly related to the lib. Many other reasons can influence it, such as availability of memory, processor, space in disk, connection, phone connection, functions used, and the own Meta.
I use the lib to recover passwords of my systems, so my use of it is low, and I have only a few messages a day, and my connection persists for months. As a result, that question is more about how you use the lib.
if you changed from chromium to chrome for example, and still have the old chromium session, you need to delete your whole LocalAuth folder and create a new one with QRCode or it won't work, in my experience. Weird connecting errors happen. When you delete the wwebjsauth folder and log in with QR again, it's normal.
Same with switching from chromium to edge... chrome to edge... I believe
I did not change any binaries, by saying chrome I meant either chromium or chrome or whatever wspweb.js opened