Skip to content
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

localStorage not persistent #68

Open
tuurep opened this issue Aug 11, 2023 · 2 comments · May be fixed by #76
Open

localStorage not persistent #68

tuurep opened this issue Aug 11, 2023 · 2 comments · May be fixed by #76
Labels
bug Something isn't working

Comments

@tuurep
Copy link

tuurep commented Aug 11, 2023

Environment

$ web-greeter --version
3.5.2

Bug description

Hello, I wanted to create an issue for this as it took me quite some time to find a Reddit thread that describes it:

https://www.reddit.com/r/linuxquestions/comments/12uhsyr/comment/jh8yi8o/?context=3

... it seems to be that storage sessions are not saved before nody-greeter/web-greeter closes; they work until the program is closed by lightdm. I didn't find a right solution back then so this will have to wait unless someone else tries to fix it.

I think this should be tracked as an issue so attempts to fix it can be made.

My issue when writing a theme was that right before running lightdm.start_session(id) I try to cache the last logged in user this way:

localStorage.setItem("LAST_USER", lightdm.authentication_user);

However, it doesn't appear to be cached on the next reboot. The reddit thread describes this same issue as far as I understand.

Steps to reproduce

In a web-greeter theme:

  1. try to cache last user before starting session:
  • localStorage.setItem("LAST_USER", lightdm.authentication_user)
  1. try to retrieve cached user next time using the theme:
  • localStorage.getItem("LAST_USER")

Note: In some cases it seems like the storage works, but trying to setItem() right before starting the session, for me that's how it consistently fails.

Expected behavior

When rebooting, key "LAST_USER" is found on localStorage

@tuurep tuurep added the bug Something isn't working label Aug 11, 2023
@tuurep
Copy link
Author

tuurep commented Aug 11, 2023

Now saw this issue in nody-greeter: JezerM/nody-greeter#41

Describes the same bug

@JezerM JezerM pinned this issue Mar 14, 2024
@JezerM JezerM linked a pull request Mar 31, 2024 that will close this issue
@JezerM
Copy link
Owner

JezerM commented Mar 31, 2024

Hi, @tuurep. I made a PR that tries to solve this issue in web-greeter, I'd like you to test it and tell me if it works :'D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants