Implementing automatic logout in silverlight and wcf due to user inactivity

Posted by rubin-attack on Stack Overflow See other posts from Stack Overflow or by rubin-attack
Published on 2010-04-05T15:34:05Z Indexed on 2010/04/05 16:23 UTC
Read the original article Hit count: 895

Filed under:
|
|
|

I have a WCF web-service and a Silverlight app displaying data from that service. In my service I'd like to implement automatic logout of the user, if no service methods were invoked during a period of time (for example 20 minutes).

I'm thinking about smth like that:

Dictionary<User,TimeSpan> Inactivity

When a service method is invoked i reset the TimeSpan. But what will happen, if 20 minutes pass, and I call the Logout method (which clears all User caches), and suddenly the User returns from lunch)) and presses a button in his Silverlight app? Obviously he'll get an error. Is there any way to avoid this, or all my concept is wrong? Maybe there's a better way to logout the user automatically?

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about wcf