Answered by:
End ASP Session From Silverlight

Question
-
In our old ASP app we used to have a "Logout" button which would end the ASP session. We have now removed all ASP controls fro mour page so that we have a pure Silverlight UI. What JavaScript would have I have to execute to end the current ASP session?
Wednesday, April 28, 2010 7:57 PM
Answers
-
I understand. What you said previously was that you used to have a logoff button. If you put one in your silverlight code, the click event would make a call to your WCF service which would do the Session.Abandon(). The call is just like anyother call to your services. I assume you are hosting your SL objects in .aspx pages, which means you would have a session for that browser instance.
Thursday, April 29, 2010 4:25 AM
All replies
-
What kind of web services are you using and what security model are you using? It may be possible to make a call to your web services and do a Session.Abandon.
Wednesday, April 28, 2010 9:40 PM -
Sorry, should have said
HttpContext
.Current.Session.Abandon();Wednesday, April 28, 2010 9:41 PM -
I am using WCF services with ASP.Net Compatibility. What you have suggested would work on the ASP side, but on the Silverlight side, I don't have access to the HttpContext. So I need to run some JavaScript to force the browser to drop the cookie that keeps the browser connected to the ASP session.
Wednesday, April 28, 2010 10:17 PM -
I understand. What you said previously was that you used to have a logoff button. If you put one in your silverlight code, the click event would make a call to your WCF service which would do the Session.Abandon(). The call is just like anyother call to your services. I assume you are hosting your SL objects in .aspx pages, which means you would have a session for that browser instance.
Thursday, April 29, 2010 4:25 AM -
Thursday, April 29, 2010 4:32 AM