1

Scenario: My general portal is hosted in IIS using ASP.NET and a login page. After successful login via WCF service, the session token is stored in the HTTPContext.Current.Session under mytoken.

The portal page hosts a Silverlight app in an iframe. The SL app opens a new tab using System.Windows.Browser.HtmlPage.Window.Navigate().

The tab is supposed to offer a file for download. The page called is an aspx page. It accesses HTTPContext.Current.Session["mytoken"] to get the current session token.

This works fine at all my customers except one.

Problem: At this one customer, the download tab gets null from HTTPContext.Current.Sessions["mytoken"]. I added a trace to confirm that. It does not work in either IE or Firefox.

The download page works fine when called on the web server directly. And each customer has a very similar setup and it works everywhere but at one site.

Does anybody know what to look for? How can the session be shared at all sites except one?

Thanks for any help!

Kevin Aenmey
  • 13,259
  • 5
  • 46
  • 45
Wolfgang
  • 211
  • 1
  • 2
  • 10

1 Answers1

0

We found the reason for our problem. It had something to do with using the IP address and/or the machine name in the URL.

It does not work if the portal uses http://machine1/portal/main.aspx and the new tab uses http://123.345.789.123/portal/download.aspx. Or the other way round. It seems that the session is not shared in that case, even though the IP address is the one belonging to the machine name.

I had the base URL for the download link hard-coded in the configuration of the SL app. So it did not build the download aspx's URL dynamically based on its own root URL.

I am now using Application.Current.Host.Source and its properties Source, Scheme and Port to construct the base URL on the fly in the Silverlight cllient.

Everything works like a charm now.

Wolfgang
  • 211
  • 1
  • 2
  • 10