Closed kevinchugh closed 5 years ago
I'm not sure I understand the question. The plugin already works per user. The timeout is managed in the session and each user who logs into the Rails app gets their own unique session.
thanks for responding. the read me implies there is a global timeout. i want to know if i can have these 10 users timeout after 10 minutes, but those 20 users timeout after 2 hours.
there's a weird github bug that closes issues, i didn't close this, just fyi
Correct, the timeout itself applies globally and is not configurable per user. I'm happy to accept pull request, though, if you would like to make this modification yourself.
great, thanks
@pelargir i haven't tried it, but from reading the code it appears that you can leave the global timeout unspecified and set the user specific value in the auto_timeout
method on the user mdoel. can you confirm this will remain a supported way of doing per-user timeouts?
/cc @kevinchugh
It looks like that would work, yes. I have no plans to change it.
@kevinchugh per @gsar you can achieve what you want by adding an #auto_timeout
method to your user model and returning a timeout (in seconds) from there.
class ApplicationController < ActionController::Base
auto_session_timeout
end
class User < ActiveRecord::Base
def auto_timeout
15.minutes
end
end
Please reopen this issue if that does not work for you.
I've updated the README with these instructions. Thank you both.
we want orgs to be able to set their own timeout, can this be done? per user or per some other record value?