0
1

Hi folks,

could you please add a simple demo for an automatic application session timeout ?

TASK: Application will automatically logout (run logout action) after certain time which elapsed after user's inactivity with application.

How to catch a user's application inactivity?

Thanks, Tomas

asked 26 Sep '12, 23:32

Tomeo's gravatar image

Tomeo
162135
accept rate: 3%


Hi Tomas,

I prepared the demo application, here's the link;

http://formspideronline.com/formspider/main.html?name=DemoMain#DemoSessionTimeout

Short description

In this demo application, the session timeout value of the application is 10 seconds. A timer with an interval value of 5 seconds starts just when the application opens (see startSessionTimeoutChecker procedure). In fact, this timer send a dummy request to the server at every 5 seconds, which forces the server to generate the "Session Expired" event if it's necessary (if the session is timed out). Therefore, at worst case, you will be able to catch the user inactivity with a 5 second delay. Since it's demo application I used 5 seconds as timer interval value but in a real application, we do not recommend an interval value value lesser than 60 seconds.

When the "Session Expired" event of the application occurs, you can apply your logout logic (see sessionExpired procedure). Additionally, after applying the logout logic, I show an alert to inform the user about the session timeout and then restart the application.

Step by step implementation

  • Press "Edit Current Application", navigate to "Session" tab and enter 10 as session timeout value.
  • Create a timer with an interval value of 5 seconds. Please make sure that the "Repeat" checkBox is ticked.
  • Create a procedure where you start the timer and create the corresponding action.
  • Press "Edit Current Application", navigate to "Events" tab and assign the action which starts your timer to the "Post Open" event of the application.
  • Create an alert to show when the application is timed out.
  • Create a procedure and corresponding action to be used when the session is expired (logout logic + alert show + application close/restart)
  • Press "Edit Current Application", navigate to "Events" tab and assign this action to the "Session Expired" event of the application.

Regards, Ibrahim

link

answered 27 Sep '12, 04:06

Ibrahim%20Sandalli's gravatar image

Ibrahim Sand... ♦♦
1.5k5
accept rate: 25%

edited 27 Sep '12, 07:33

Hi Ibrahim,

that's perfect - exactly what we need.

Would you mind to send me this demo to my email, as currently I'm having a problem to see a "Design XML" tab under demos. Issue logged in other threat: http://osqa.theformspider.com/questions/532/problem-to-see-code-in-design-xml-tab-in-demos

Kind regards, Tomas

link

answered 27 Sep '12, 07:06

Tomeo's gravatar image

Tomeo
162135
accept rate: 3%

Hi Tomas,

I deployed the application to your formspideronline account. Also, I sent you an email containing the application's export XML and package DDL.

Sorry for the problem again.

Kind Regards, Ibrahim

(27 Sep '12, 07:42) Ibrahim Sand... ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×7
×1

Asked: 26 Sep '12, 23:32

Seen: 1,685 times

Last updated: 27 Sep '12, 08:01


© Copyright Gerger 2017