I have a child iframe
in my page that will load content from a different web application in a different virtual directory than the parent page.
The DOM will look roughly like this:
<html>
<!-- Content from www.contoso.com/WebApp1/Home -->
<div id="parentDiv" />
<iframe>
<!-- Content from www.contoso.com/WebApp2/Home -->
<div id="childDiv" />
</iframe>
</html>
- The user will log in to
www.contoso.com/WebApp1
. - The user will load
www.contoso.com/WebApp1/Home
which contains aniframe
with content fromwww.contoso.com/WebApp2/Home
. - To load content from
www.contoso.com/WebApp2/Home
the user must be logged in.
My Question:
- Could I simply load the
iframe
withsrc=www.contoso.com/WebApp2/Home?sessionId={sessionIdFromTheParentCookie}
, and write server-side code to trust the incoming sessionId and set a cookie for the childiframe
? - At present, I can't see how this is any worse than the reality that a user could tamper with his/her client-side cookie an insert an arbitrary sessionId in it.
- The sessionId must always be validated at the server, so what's the harm in supplying an arbitrary sessionId in the query string and asking the server to set the cookie?