1

I have two applications running on different domains:

  1. webformapp.com
  2. mvcapp.com

webformapp.com has an iframe which points to mvcapp.com. Now I want to keep session alive in webformapp.com when there is an activity on mvcapp.com. I have implemented a generic handler(KeepAlive.ashx) in webformapp.com and tried to call from mvcapp.com to keep session alive on webformapp.com, but I guess because of cross domain access restriction, directly calling webformapp.com/KeepAlive.ashx from mvcapp.com through a simple http get / post request isn't hitting the handler. Solution given here is for same domain I guess. Any simpler solution to implement keep alive mechanism in this scenario?

Community
  • 1
  • 1
Nexus23
  • 6,195
  • 9
  • 50
  • 67
  • If the apps are in different domains and one of them is referenced inside an iframe on the other app; I don't see why the Session of any of the two could become invalid. Both sessions should continue to be valid for as long as the Session timeout setting is configured in web.config. How are you testing this? – Icarus Aug 14 '12 at 14:51
  • Two websites are independent from each other. Iframed site doesn't refresh the session of parent website by default unless specified otherwise. Iframe is just a window for another website according to my knowledge. – Nexus23 Aug 14 '12 at 15:05
  • your knowledge is correct. I guess I don't understand the question, then... – Icarus Aug 14 '12 at 15:07

1 Answers1

0

If I understand your question, the user is actively doing things on The mvc app within an iframe served by the webform app. Are you able to have a javascript timeout post heartbeats to the webform app as long as that browser window is open, from the browser outside the iframe?

Ive done similar things in the past where i maintained a counter in their session and after x refreshes the handler would respond with a failure code which the browser can respond to with a redirect prompt or what have you.

Michael Christensen
  • 1,768
  • 1
  • 13
  • 11