Using a repository style pattern it's quite easy to check that you are still logged in. Your repo will expose things you can do on your service. It will also have a private method to construct or get your service client that each service call will use. Check at this point. If the session is null etc then create your login view - using action callbacks all the way to continue from where you left off. I would pop you some code If you need.
Btw I'd never circumvent the server timeout by extending it to 24 hours etc. It's far more than just a resource problem-it increases the surface area of session hijacking etc exponentially. Cheers, Jordan On 17/07/2010, at 9:47 PM, <[email protected]> wrote: > The way I do it is by first off avoid using sessions, because if you need to > scale to multiple servers you will run into problems. > > Second, it sounds like you are using the Membership model of ASP.NET, so > write the authentication cookie yourself and set it to persist after you > validate the user of course: > FormsAuthentication.SetAuthCookie(identityName, true); > > > From: Tony Wright > Sent: Saturday, July 17, 2010 6:51 AM > To: 'ozSilverlight' > Subject: RE: Timeouts in Silverlight > > Oh, because the exception isn’t a timeout exception – it’s generally a null > exception which could be from a multitude of reasons. > > > > > > From: [email protected] > [mailto:[email protected]] On Behalf Of Peter Gfader > Sent: Saturday, 17 July 2010 5:33 PM > To: ozSilverlight > Subject: Re: Timeouts in Silverlight > > > > >>By this time, the authentication context has disappeared, so as soon as > >>they do something, it raises exceptions. > Why you don't handle that exception and redirect to the login page? > > > > > > .peter.gfader. > > http://blog.gfader.com/ > > http://twitter.com/peitor > > > > > > On Sat, Jul 17, 2010 at 10:06 AM, Tony Wright <[email protected]> wrote: > > Hi all, > > > > One thing preventing my Silverlight application being of an acceptable level > of quality to release to our customers is Timeouts. > > > > Basically, our customers are known to leave the application open in their > browser after using it, going off and doing something else, and then > returning later on to use it again. By this time, the authentication context > has disappeared, so as soon as they do something, it raises exceptions. The > only way to resolve it when this happens is to close the application in the > browser an start again. > > > > Now, we could extend the session to be for 24 hours, as the web site is > recycled overnight anyway, however this reduces scalability as all those > resources are locked unnecessarily. > > > > We could also use a timer to timeout the page before the session times out. > This can be complicated, because we have to make sure that every user event > resets the timer. Again, an undesirable. > > > > So I guess my question is, to create a rock solid Silverlight application, > and given that Silverlight has a far superior eventing system to asp.net, is > it possible to hook something in to the Session Ended event that I can use to > redirect back to the login page or perform some action? > > Regards, > Tony Wright > Director / Principal Consultant > Hazaa Pty Ltd > m: +61 424 225 393 | e: [email protected] | w: http://www.hazaa.com.au > > > _______________________________________________ > ozsilverlight mailing list > [email protected] > http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight > > > > _______________________________________________ > ozsilverlight mailing list > [email protected] > http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight > _______________________________________________ > ozsilverlight mailing list > [email protected] > http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
_______________________________________________ ozsilverlight mailing list [email protected] http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
