Module 4 Unit 6 Making Your ESP32 Web Server Password Protected
I can use this log in code and it does log in the 1st time I do it. If I drop the Browser and then open the web page again I do not get the log in screen – it goes straight to the web page (with the buttons). The only way I can get back to the login screen is to reboot the PC. I have also tried clearing the cache – no luck.
Is there anyway of logging out automatically or manually?
Or what am I doing wrong?
Thanks
Andy
Hello Andy, the authentication is saved in your web browser cache. So to be honest, I’m not sure why that’s happening. To log out, you have two options:
- you can clear your cache
- or when using the web server outside your devices, you can use the “incognito mode”
Which browser are you using? Did you restart your ESP8266 after clearing your cache?
Thanks for your patience.
Regards,
Rui
Hi Rui,
Many Thanks for your reply. Firstly I am following the “Learn ESP32 with Arduino IDE” and thus it is the ESP32 board that I am using.
I have moved onto the following Unit “Accessing the ESP32 Web Server From Anywhere” and I do not get a problem; it does provide me with the log in screen.
Revisiting the Unit “Making Your ESP32 Web Server Password Protected”.
I am using the Google Chrome Browser and had “cleared the cache” before
If I go back to how I was before then I can still replicate the problem. However If I follow your advice I again looked at Chrome and had not noticed that there is an option:
Clear Data for “Passwords and other sign-in data”
This cures my problem.
I know that this is probably beyond this course but what I was also asking is; If I visit a web site there is usually an option to Log Out or If the web page is dropped then the sign in on the web page is also dropped automatically. Is this possible to implement?
However as far as the course is concerned – then I am now happy.
Many Thanks
Andy
Exactly! You need to clear the “Other sign-in data”, because it’s authentication data to access a web page.
This is a common question, so I’ve already tried to re-search a method to log out in the past. Unfortunately I’ve tried to search for a solution using different methods and I don’t think there’s a link or an easy solution that we could add to the web server that would clear that web browser data on disconnect… At least, I’ve tried to search and I couldn’t find anything that would allow us to that.
You’re welcome! I’m glad you’re enjoying the course.
Regards,
Rui