I am using joomla 1.5. I have a separate code which is in the same domain but in an another folder. I am accessing that folder within my joomla code by making use of iframe. Now I have to send the session value from joomla application to iframe and I am doing that by the following code.
echo '<iframe src="https://localhost/demo/quiz/quiz_main.php?u_d='.$user->id.'" width="910" height="885" style="background-color:transparent"></iframe>';
where $user->id is the registered user’d id and obviously this page will open if user logs in.
Then in the quiz_main.php page I am checking the value of u_d and according to that I am controlling the system.
Now the problem is suppose, I opened two tabs in the same browser with the same url and log in with same user id. Now log out from one tab. Then go to the other tab. User can perform any action for that small application which is running inside the iframe, until the page is not refreshed . But it should not be.
Please help me how to fix this issue.
You have to perform the check server side anyway, so in
quiz_main.phpyou’ll need something likeTo prevent the user from performing any actions that will affect data on the server.
You can also do a check client side using JavaScript. You can poll the server every
nseconds to check if the user still is logged in, and if not redirect the user to the appropriate page.Example below with jQuery
Just a rough sketch on how this could be done. You’ll need a
logged_in.phpto handle to your request of course.