Welcome Guest, Not a member yet? Register   Sign In
iFrame & session issues
#1

[eluser]SP1966[/eluser]
I'm using Fancybox to pop up sub forms for some data entry on my site. The issue is that when a user steps away from their computer long enough for their session to timeout and then tries to use the pre-loaded Fancybox form they are redirected to the login page, inside of the Fancybox popup which of course will then log them into the site and load the main page within the iFrame giving them two version of the site within the one window.

Any tips on how to detect this and redirect the top level page and not the iFrame page?

#2

[eluser]royduin[/eluser]
Check if the session exists, if not redirect the parent, see: http://stackoverflow.com/questions/58066...javascript

Example:
Code:
<? if( ! $this->session->userdata('item') ){ ?>
[removed]window.top.location.href = "<? echo site_url(); ?>";[removed]
<? } ?>




Theme © iAndrew 2016 - Forum software by © MyBB