abp
abp copied to clipboard
Session stays valid after purging & recreating database
Is there an existing issue for this?
- [X] I have searched the existing issues
Description
I'm creating a fresh project using the layered app template.
Recently I was signed in, made some changes to my migrations file and decided to delete all tables & re-run the DbMigrator to fill the database from a fresh state.
To my suprise after I started the webserver again and went to the page, I was still signed in. Once I tried to create some data I even got an error where the insert failed because the User ID didn't match a foreign key on the users table. Somehow, it still was using the previous GUID of the admin user. After logging out & logging back in this was resolved.
Reproduction Steps
- Create a new project
- Run migrations
- Start webserver
- Login on the website
- stop webserver
- Delete tables from database
- Run migrations
- Start webserver
- Go back to the website, you will still be logged in.
Expected behavior
The session should have been invalidated
Actual behavior
User is still signed in with the old user information
Regression?
No response
Known Workarounds
No response
Version
6.0.1
User Interface
Common (Default)
Database Provider
EF Core (Default)
Tiered or separate authentication server
None (Default)
Operation System
Linux
Other information
No response
hi
Try to clear the Redis.
I don't have Redis running / configured. It's all in my local development environment, just a MSSQL database and this project's code.
Because the cookies of localhost are still valid. So the above problems will occur.
How can the cookies of localhost stay valid if there's nothing to validate them against?
And even worse, how can they use the GUID of the old user?
IMO this should never be happening and is definitely a bug.
This is not the scope of the abp framework. The asp net core identity project template is the same.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.