• Logout cannot work

    By Ramli Xu 1 decade ago

    When I logout, it will return to home.xsp page.

    We already use session-based login authentication in our server.

    Any other thing need to set ?

    • More info

      By Thomas Adrian 1 decade ago

      I have no problem logging in and out using Chrome, Firefox or IE 9

      Please provde a scenario I can reproduce with browser versions, etc.

      Please also state if it do not work in any browser or in a specific one.

       

      I love to solve this for you, but first I must understand the problem,

       

      thanks

      Thomas

    • Cookies clear but no logout

      By Ramli Xu 1 decade ago

      I got below error log when I logout.

       

      • need help

        By Thomas Adrian 1 decade ago

        thank you for reporting this

        I need your help troubleshooting this please check in different browsers and look for errror using firebug or develper tools
        I also need to know what server OS, Domino and extlib version you are using
         

        if you want you can mail me a copy of your database and I can test it in my environment
        thomas.adrian (a) consili.se

         

        • Login using Lotus Domino Account cannot logout

          By Ramli Xu 1 decade ago

          Hi Thomas,

          I found the problem is because I log in using Lotus Domino account.

          Because your code do not call ?logout, so it seems User always login in, unless they close the browser (session).

          • Works for me

            By Thomas Adrian 1 decade ago

            It is still strange that it does not work for you, for me it works every time.

            Can you please report to me which version of server and browser you are using and maybe try another browser?

             

            thanks

            Thoma

            • My workaround

              By Ramli Xu 1 decade ago

              Hi Thomas,

              Thank you for your quick response, but I still cannot solve logout problem for Domino,

              So i just change the code for Logout, may be can be used by other users that face the same problem, until I found our problem.

              In popuser (ccSearchBar) - onItemClick :

              try{
                  var s = context.getSubmittedValue();
                  var v = @RightBack(s,"$");
                  var label = @Left(s,"$");
                  var userid = getCookieValueX("userid");
                  var udoc:NotesDocument = getUserDoc(userid);
                  
                  if(s=="ft"){
                      database.updateFTIndex(true)
                      return;
                  }
                  if(s=="debug"){
                      var d= sessionScope.get("debug");
                      if(d =="1"){
                          sessionScope.remove("debug");
                      }else{
                          sessionScope.put("debug","1")
                      }
                      return;
                  }
                  
                  switch(label){
                      case "logout":
                          
                          if(udoc){
                              udoc.replaceItemValue("LoginToken","")
                              udoc.save();
                          }
                          addCookieX("userid","","remove");
                          addCookieX("xid","","remove");
                          removeDomCookies("DomAuthSessId");
                          removeDomCookies("SessionID");
                          
                          var curURL = facesContext.getExternalContext().getRequest().getContextPath();
                          var loginURL = "/names.nsf?logout&redirectto="+curURL;
                          facesContext.getExternalContext().redirect(loginURL);
                          break;
                      case "themes":
                          udoc.replaceItemValue("Theme",v)
                          udoc.save();
                          context.redirectToPage("home")    
                          break;
                      case "lan":
                          udoc.replaceItemValue("Language",v)
                          udoc.save();
                          context.redirectToPage("home")    
                          break;
                  }
                  
              } catch(e){
                  doLog("searchbar dropdown error " + e)
              }
               

              In home.xsp - beforePageLoad :

              try{
                  commonBeforePageLoad()
                  
                  var c = getCookieValueX("userid");
                  var xid = getCookieValueX("xid");
                  var xLtpaToken = getCookieValueX("LtpaToken");
                  if (xLtpaToken == "") {
                      if(c=="" || xid==""){
                          addCookieX("userid","","remove");
                          addCookieX("xid","","remove");
                          context.redirectToPage("start");
                      }
                  } else {
                      if(@UserName()=="Anonymous"){
                          addCookieX("userid","","remove");
                          addCookieX("xid","","remove");
                          context.redirectToPage("start");
                      }
                  }
                  
                  var ud = getUserDoc(c);
                  if(!ud){
                      addCookieX("userid","","remove");
                      addCookieX("xid","","remove");
                  }

              } catch(e){
                  doLog("BeforePageLoad Error home.xsp " + e,"1")
              }