'Coldfusion onRequestStart show some error

I try to write a onRequestStart function in application.cfc and code is

 function onRequestStart(requestname){ 
    if(!structKeyExists(session, "UserId") or !structKeyExists(session, "LoggedIn") ){
        if(!(find("login",requestname) > 0 or find("signup",requestname) > 0)){
           location("/mobile/index.cfm",false);
        }
    }else{
            location("/mobile/dashbord.cfm",false);
    }
}

the above code if condition is working ,after login the else condition will show This page isn’t working127.0.0.1 redirected you too many times. this error. why show this error , i am new in coldfusion please help me to solve this issue.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source