Question

I have a silverlight Ria application . I use the WebContext to make the authentication staff. I have these line in the App.cs constructor (it already come with the silverlight business teplate) : InitializeComponent();

WebContext webContext = new WebContext();
webContext.Authentication = new FormsWithTimeoutAuthentication(20);

this.ApplicationLifetimeObjects.Add(webContext);

I face a problem , when I open the application in one browser tab , every thing is ok , I try to open another tab and to log in with different user it affect the application in the first tab . I traced the WebContext hashcode and get the same thing. So the WebContext seems to be shared on the both application instances.

Do you have any idea why this happen ? Thanks in advance ...

Was it helpful?

Solution

Silverlight uses the browser's http stack for authentication. When you use Forms Authentication, a browser cookie is sent to the browser and this identifies your current browser session's authenticated user. All browser tabs share the same cookie, and hence all tabs are identified as the same user.

To avoid this issue, you should use "Private Browsing" on Internet Explorer, or use "Incognito" on Google Chrome.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top