SoftwareGeek
SoftwareGeek

Reputation: 15772

Are ASP.Net sessions shared between iframes?

Can two or more iframes share the same session data?

Upvotes: 1

Views: 2402

Answers (2)

JasonTrue
JasonTrue

Reputation: 19634

Session data is stored by your server. Iframes are just "pages".

If the requests for both pages are served by the same server (or farm in the event of a suitably configured load-balanced environment), the requests have access to the same session data.

You can run into temporal issues in some circumstances; namely, if you set some session variable during the request for one page, but the other iframe expects that value to be set already, you won't have what you want.

Upvotes: 4

AlfonsoML
AlfonsoML

Reputation: 12740

Yes. If they are in the same web application they will share the same session

Upvotes: 3

Related Questions