-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
req.user undefined when calling cloud function with sessionToken after about a week #3299
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
Comments
I should also add that the iOS app, which calls the cloud function directly, doesn't have the issue. |
I am not really an expert on these things but would it just indicate the the cookie has expired (on the client) after a week? Obviously not an issue in iOs but perhaps something in your browser? |
@araskin but logging out and re-logging back in, which should refresh the token on the client, also doesn't work... I will have to wait till it happens again and see if clearing the cookie would fix it. |
Interesting. So what happens during the log out/log in process? Does you get back a session token after successful login? |
what happened with this resolution? I'm having the same issue, restarting parse-server makes the passed sessiontoken be recognized as a user in cloud code calls until i log out and log in again then its undefined again |
@aPatrickStar, what version are you running? Please update to the latest and reopen a new issue if it persists |
Issue Description
I have a web app that stores sessionToken in cookie
session.token
. It will make GET or POST requests to the server which will then useParse.Cloud.run("<cloud function>", {<params>}, {sessionToken: req.session.token})
to call a cloud function to get data.When server is freshly (re)started, everything is normal, all cloud functions called by the above method have valid request.user. However, after it's running for about a week, req.user will become undefined. Logging out and logging back in, which refreshes the session token in the client, does not fix the issue. Restarting the server fixes the issue.
This has been happening for a few times now, and I've make some changes to the server-side login and storing/passing the token from web page to server, but it continues to happen. Not sure if it's my implementation, or an issue with the server. Would love some help here.
My Implementation
Server-side login:
The POST request for data:
The cloud function that gets the data:
Environment Setup
Server
Database
Logs/Trace
The text was updated successfully, but these errors were encountered: