-
Notifications
You must be signed in to change notification settings - Fork 228
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
Session timeout module does not logout user #303
Comments
@PedroAugustoRamalhoDuarte there isn't enough information for me to tell what's going wrong. Can you please create a minimal app to reproduce this issue? The first thing that comes to mind is that sessions are failing to invalidate entirely. Have you tried setting a session variable, resetting the session, and checking that the variable was cleared? e.g. session[:testing] = 'some value'
reset_session
byebug
|
@athix thanks for the response, i will try to create a minimal app to reproduce this bug, maybe is the remember_me module in conflict with session_timeout module |
@athix here is the repo (https://github.com/PedroAugustoRamalhoDuarte/sorcery-session-timeout), to reproduce the bug:
I guess session_timeout destroy the session, but remeber_me creates a new session, maybe the fixes is add a forget_me! at session_timeout validate_session method |
I add forget_me! method to controller/submodules/session_timeout and works. def validate_session
session_to_use = Config.session_timeout_from_last_action ? session[:last_action_time] : session[:login_time]
if (session_to_use && sorcery_session_expired?(session_to_use.to_time)) || sorcery_session_invalidated?
forget_me!
reset_sorcery_session
remove_instance_variable :@current_user if defined? @current_user
else
session[:last_action_time] = Time.now.in_time_zone
end
end |
I will create a pull request |
I have configured sorcery to include session time out module, but when the sorcery try to reset_sessions in validate_session method in controller/submodules/session_timeout.rb the user is not logged out.
Here my config:
config/sorcery.rb
migrate
Configuration
0.16.1
2.7.2
Rails 6.1.4.4
Linux
Expected Behavior
After 5 seconds of login the session is invalid
Actual Behavior
The user can still authenticate in platform
Steps to Reproduce
Just login and wait for 5 seconds, and does not works
Debug
When i add logout line in sorcery code, its works
The text was updated successfully, but these errors were encountered: