Click here to Skip to main content
15,889,450 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
A particular session timeout functionality works when a webpage is loaded. The webpage has parent/child windows. This timeout functionality works in the parent window(home page) even when the child windows are open. And so i included the following code.

C#
function checkForParent()
    {
        try
        {
                var x_win = window.self;
                while(x_win!="undefined")
                {
                    if(typeof(x_win.opener)=="undefined")
                    {
                          x_win.resetSessionCounter();
                      break;
                    }
                            else
                            {
                               x_win = x_win.opener;
                            }
                }
        }
        catch(e)
        {
            window.status="Exception occurred during session counter update "+e.description;
        }
    }

But when the same webpage is accesssed through a hyperlink the time out functionality does not work. this may be because the code takes the page which has the hyperlink as the parent and never calls the resetSessionCounter() function.Please help me out to solve this issue so that the functionality works even when the webpage is accessed through a hyperlink.
Posted
Updated 12-Mar-11 19:58pm
v2
Comments
Sunasara Imdadhusen 11-Mar-11 6:43am    
Can you please elaborate more?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900