David Bell
David Bell

Reputation: 86

ASP.NET iFrame Session Variables

I have a login page for the admin side of a website embedded via an iFrame into the front end site. On a button click in the embedded frame the log-in details are checked and a session variable is set.

Let's say the domain for the front end site is http://SiteA, the iFrame is embedded as:

<iframe name="myFrame" src="http://SiteB/MyLogin.aspx" ></iframe>

after the button click in the iFrame, the entire window on SiteA is redirected via a javascript call:

window.parent.location = "http://SiteB/home.aspx"

I want the session variable created from the iFrame, with a src of http://SiteB, to be stored and accessible when I'm now at SiteB after the redirect.

Is this variable still classed as a 3rd party session variable even though it was created within a frame with the same source as it is subsequently being accessed? And if so is there an alternative way, without the use of p3p policies or resorting to the querystring?

Additional Info

The login.aspx pages works as desired when accessed directly, not in the iFrame. It also works when the redirect remains within the iFrame, i.e.

window.location = "http://SiteB/home.aspx"

Upvotes: 4

Views: 2830

Answers (1)

Ryan Kohn
Ryan Kohn

Reputation: 13509

Because the session variable was created on the same domain, there should be no issue in accessing it from http://SiteB/Home.aspx.

Upvotes: 1

Related Questions