8

We have a visualforce page that serves as a somewhat live dashboard for information in our salesforce instance. Through javascript and Javascript remoting (remote actions), we are polling salesforce for data every couple of minutes.

My question is around sessions and timeouts. Will these remote action invocations serve as "activity" and keep the session alive if there is no other user interaction on the page? I couldn't seem to find anything in the documentation that addressed this directly.

Ideally, we'd like to leave this page up all day without having the session time out.

2
  • I'm not really sure, but is it not that "Session Settings" that could be edited at "Setup > Security Controls > Session Settings"? – Sergej Utko Dec 17 '12 at 14:27
  • In the session settings, you can set the timeout interval. Your session will auto-timeout if you hit that interval and the user has recorded no "activity". My questions is this: If your only activity is remote actions from Javascript, will you eventually timeout? Or does that remote action count as activity, thus, keeping your session alive? – Kevin O'Hara Dec 17 '12 at 14:38
5

I think I got the answer that I was looking for.

Here is what I did...

  1. Set the session timeout settings to 30 minutes
  2. Launched my VF page
  3. Allowed it to run, by itself, for about an hour. During this time the Remote Actions were triggered about every minute or so.

I received no errors. I can only assume that this means that the Remote Actions triggered user activity, thus keeping my session alive.

4
  • 2
    Definitely the best way to test this question! From my experience the answer is YES, your session will be kept alive by polled RemoteAction invocations. However, I don't that each RemoteAction invocation resets Salesforce's session timeout JavaScript timer (which causes that annoying popup window to show up). So you might want to manually clear and reset that timeout. – zachelrath Dec 17 '12 at 17:31
  • Thanks for the clarification. I'll look into the Javascript timer and see if I can reset that. – Kevin O'Hara Dec 17 '12 at 18:36
  • Did anyone figure out how to reverse engineer the javascript that fires the popup? I've got a customer who is saying their popup is showing then logging them out if they don't make a choice with a few seconds. – Mike Tetlow Jun 29 '16 at 16:00
  • @KevinO'Hara were you able to find a clean workaround for this? – Phil B Jan 4 '17 at 14:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.