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

Setting user session doesn't work on mobile devices #258

Open
michalwinter opened this issue Oct 25, 2024 · 4 comments
Open

Setting user session doesn't work on mobile devices #258

michalwinter opened this issue Oct 25, 2024 · 4 comments
Labels
question Further information is requested

Comments

@michalwinter
Copy link

Hello,
in my login API event handler, I am using the setUserSession() function to set the information of the logged in user.
image

On my local machine (my PC), the session setting works without any problems. But on my mobile devices, which access the dev website throught the local network, it doesnt work at all.

I have tried catching any errors as you can see, but after the session is set using the setUserSession() and after I try to fetch the session in the middleware, it comes out as not logged in.
image

Not sure if this problem is with my devices or if it has to do something with Nuxt being hosted on a different machine and being accessed through local network, but thanks for any kind of help.

Cheers, Michal.

@michalwinter
Copy link
Author

michalwinter commented Oct 25, 2024

I have tried getting the session back right after setting the session in the server api file and it returns the correct set object. But back on the client side, the fetch returns nothing.

image

But what I have found out, is that the sessions output differ on mobile and on PC. (Top is mobile device, under it is log from PC device request)

image

@atinux
Copy link
Owner

atinux commented Oct 27, 2024

One issue could be that your mobile does not send the cookie is not on https connexion

try deploying your project to see if the error persists

@atinux atinux added the question Further information is requested label Oct 27, 2024
@shurth
Copy link

shurth commented Oct 30, 2024

@atinux is there a way to disable secure? I just plugged this framework into a local network only app and I have the same issue when I deploy it to my home lab .. just found this question.

@tinegaCollins
Copy link

Can this be fixed on testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants