We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25551 ☆ A M B ☆
    • 1,231 Posts
    Quote from: mcclausky at Nov 12, 2008, 11:08 AM

    Quote from: rossco at Nov 12, 2008, 10:48 AM


    Any more on this issue??? I am having all sorts of issues with this problem.

    No news about this issue for months. Perhaps we should start a new thread about it?

    I have.... lol

    http://modxcms.com/forums/index.php/topic,30041.msg183927.html#msg183927

    Still no news on the issues at all.
      Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
      AugmentBLU - MODX Partner

      BLUcart - MODX Revolution E-Commerce & Shopping Cart
      • 7455
      • 2,204 Posts
      Looks like webloginPE destroys the session somehow
        follow me on twitter: @dimmy01
        • 3749
        • 24,544 Posts
        It may just be altering the user profile (maybe an = somewhere in the code where there should be an == ?). If the sesssion were destroyed, I think you’d be logged out of the Manager as well. Has anyone tried it when previewing from the Manager?

          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 25551 ☆ A M B ☆
          • 1,231 Posts
          Bob, if singed in as the manager and user the buttons appear so it’s only effecting the users session. If logged in as both in the same browser you think it’s working till you try another browser signed in as only the user, the problems arise again. It’s effecting all snippets or functions that require the user to be logged in that are outwith the webloginpe features. You can still edit the webloginpe features and browse areas that are locked as webloginpe still thinks you’re logged in but snippets as I said do not.

          This is happening with older versions of both modx and webloginPE so it’s not something new. I tested the setups on 2 hosts, 2 versions of modx and 1.30 and 2 beta versions of webloginPE and it remains. I have PM Scotty to see if he’s aware of anything but I realise he’s not as active as he was and may be too busy.
            Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
            AugmentBLU - MODX Partner

            BLUcart - MODX Revolution E-Commerce & Shopping Cart
            • 4041
            • 788 Posts
            This is due to the way modx stores all the users info in session variables, when its changed the session has to be refreshed apparently.
            Although I don’t use webloginPE, this is where I would start looking for an answer:

            This action starts on line 818 - 828 in webloginpe.class.php
            if ($internalKey == '' || empty($internalKey))
                            {
                                    $currentWebUser = $modx->getWebUserInfo($modx->getLoginUserID());
                                    $internalKey = $currentWebUser['internalKey'];
                                    $refreshSession = true;
                            }
                            else
                            {
                                    $currentWebUser = $modx->getWebUserInfo($internalKey);
                                    $refreshSession = false;
                            }


            and then is triggered by line 970 - 973 in webloginpe.class.php
            if ($refreshSession === true)
                            {
                                    $this->SessionHandler('start');
                            }


            Then the SessionHandler( ) at line 2218 is started which kills out the session for the webuser (although if also logged into the manager, it takes that into consideration and doesnt kill the manager session)

            Sorry no fix but at least y’all know where to start looking smiley
              xforum
              http://frsbuilders.net (under construction) forum for evolution
              • 25551 ☆ A M B ☆
              • 1,231 Posts
              I don’t know what i’m doing so I can only test if something has worked or not lol.

              From what you say, what’s the reason that a session needs to be killed when a user updates their profile? If it doesn’t kill the manager session, why kill the users? I’m asking so I understand the basics of how it works. Is there a way to mirror the managers session control so the users aren’t having to log out and in again to see a few options? If anyone can explain that would be great.

              All works perfectly as a manager just to repeat laugh
                Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                AugmentBLU - MODX Partner

                BLUcart - MODX Revolution E-Commerce & Shopping Cart
                • 4041
                • 788 Posts
                Manager session and webuser sessions are totally seperate and each have different info which the scripts look for to grab the user settings, but if you kill all sessions then it logs you out of the manager too.

                The values for the $_SESSION[’’] variables are set at login and if the profile is changed, then the session variables have to be updated, which require a relogin.

                The manager works the same way, if you change any part of your user info in the manager, you are logged out so that you have to relog to refresh the changes to the session. When the webuser profile is updated, the webloginPE script checks to see if there is a manager session set and acts accordingly (meaning if there is a manager session set, it doesnt kill the manager session when a webuser profile is updated, only the webuser part). This is what causes the unusual behavior you witnessed in the gallery admin button etc..
                  xforum
                  http://frsbuilders.net (under construction) forum for evolution
                  • 25551 ☆ A M B ☆
                  • 1,231 Posts
                  Quote from: Breezer at Nov 13, 2008, 06:19 AM

                  Manager session and webuser sessions are totally seperate and each have different info which the scripts look for to grab the user settings, but if you kill all sessions then it logs you out of the manager too.

                  The values for the $_SESSION[’’] variables are set at login and if the profile is changed, then the session variables have to be updated, which require a relogin.

                  The manager works the same way, if you change any part of your user info in the manager, you are logged out so that you have to relog to refresh the changes to the session. When the webuser profile is updated, the webloginPE script checks to see if there is a manager session set and acts accordingly (meaning if there is a manager session set, it doesnt kill the manager session when a webuser profile is updated, only the webuser part). This is what causes the unusual behavior you witnessed in the gallery admin button etc..

                  Good explanation Breezer, thanks. I have witnessed the manager signing out when you update your manager profile so I can apply the understanding to weblonginPE as well now. So for a fix, since webloginPE uses cookies and they are still saved regardless if you update your profile or not, is there a way to pull that info from the cookie to say well actually the user is logged in, therefore show XYZ as normal?

                    Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                    AugmentBLU - MODX Partner

                    BLUcart - MODX Revolution E-Commerce & Shopping Cart
                    • 31471
                    • 206 Posts
                    I didn’t try it but I found a possible cause of this problem.
                    In the webloginpe.class.php file at the end of the SaveUserProfile function (around line 970) in the code:
                    		if ($refreshSession === true)
                    		{
                    			$this->SessionHandler('start');
                    		}

                    insert one line:
                    		if ($refreshSession === true)
                    		{
                    			$this->Username = $this->User['username']; // insert this line - vhollo
                    			$this->SessionHandler('start');
                    		}


                    Because $this->Username has a value on login and register but not on saving profile.
                      • 25551 ☆ A M B ☆
                      • 1,231 Posts
                      Awesome! Looks like this has worked.... WHAT A RELIEF! It’s been bugging me for months LOL.

                      Hopefully that doesn’t have an effect on anything else now. grin
                        Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                        AugmentBLU - MODX Partner

                        BLUcart - MODX Revolution E-Commerce & Shopping Cart