Wappler Version : 4.4.5
Operating System : W10
Server Model: NodeJS
Expected behavior
When a user logs in and sets REMEMBER ME as true/1, user session should remain live in the DB.
Also, re-deployment should not clear out login status irrespective of remember me, if cookie is still valid.
All session variables should be retained as well.
Actual behavior
With one of the latest updates (I think 4.4.3), config.js had a change around session store:
store: { $type: 'memory', ttl: 86400000 }
With this, the behaviour is really weird now.
If I login without remember me, I get logged out everytime I re-deploy. Which is how NodeJS has been working since day 1.
But now, if I login with remember me = 1, on re-deployment, user still stays login. But, any session that might have been set using SET SESSION steps, are cleared out.
The remember me has nothing to do with sessions. Sessions are always temporary, data stored in session will be lost after a restart or when the session times out. The remember me stores the user credentials in a cookie in the client browser, the browser sends this cookie with every request, when the session for the logged in user is not set it will login the user with the credentials send with the cookie.
So all session variables are deleted just like before on restart, and only the cookie-based-remember-me option has been fixed/enabled from before - so that login session get created automatically?
This is normal behavior, in memory sessions get lost when the server restarts, use persistent session like redis to prevent session from being deleted on server restart.
But this was not the behaviour up until a few releases.
This was not highlighted in any of the changes lists either. Its a breaking change.
Not sure if you guys didn't catch it, but it would be good to post about this as a separate topic.
As for the current state of things, is there any option where I can disable this functionality or do I have to edit the core file and maintain it after every release?
Using redis not an option (using Caprover, so no idea how to set that up).
Experiencing this problem again.
In the earlier project, we had put in extra conditions to check if session values are not found, logout the user.
But now in another application, we are seeing the same problem.
Wappler 5.3.1
NodeJS, PostgreSQL/MariaDB
Server Connect Settings > Sessions > Session Store = database; TTL = 86400
In the global security provider, cookie settings is set to expire in 30 days. And remember me is 1 in security login.
Now, when a user logs in, and accesses the website a couple of days later, they are still logged in, which is correct - but all the session values that were saved for the user are not longer there. So, while using the app, they experience random errors.
Sessions expire after a specific time of inactivity, this is the default behavior for sessions on servers. The TTL is the Time to Live for the session, in the settings you give TTL = 86400 it is set to 1 day, so after 1 day of inactivity the session will be destroyed.
After some investigation the config should be different. You can inspect the session cookie with devtools, it is located under the Application tab. Check the Expires date of the cookie if it set to the correct date and not set to Session.