Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Logged in user is automatically logged out - howto disable


Go to End


3 Posts   1191 Views

Avatar
finrod

Community Member, 5 Posts

30 October 2013 at 9:23pm

Edited: 30/10/2013 9:23pm

Hello,

I'm working on a webapp using Silverstripe 3.1 where users can signup and login. I use the memberprofiles module for it.

I noticed that when a user is logged in, if he is inactive for a certain time (around 10 min or so) he is automatically logged out. I would like to disable this, so that the user stays logged in forever as long as he has the page open.

Any ideas which settings I should disable to accomplish this?

Thanks

Avatar
Willr

Forum Moderator, 5523 Posts

4 November 2013 at 7:05pm

Session timeouts are standard. If you want to keep the users session active, you can follow what the CMS does and do an AJAX query to ping a given URL. Userforms also does this to prevent form timeouts.

https://github.com/silverstripe/silverstripe-userforms/blob/master/code/model/UserDefinedForm.php#L458
https://github.com/silverstripe/silverstripe-userforms/blob/master/javascript/UserForm_frontend.js

Avatar
finrod

Community Member, 5 Posts

4 November 2013 at 11:42pm

Thanks Willr. This helps me a lot. It was really not clear to me where to look.

What exactly causes then the log out of the user? Is it because when the session times out logout is explicitly called somewhere or is it rather an effect of the garbage collection?