We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19646
    • 31 Posts
    Hi there

    I am working on a project which when completed I’ll pass back to the ’community’ - however I have run into quite a snag. huh

    I am using sessions but my sessions data in the form of an array is being lost "between pages" by MODx.
    I know this as i have run all my code sucessfully as "static" pages.

    The script is supposed to remember visitor the "choices list" as the navigate through the web pages.
    These choices are then displayed so the visitor can see them accumlate using ajax.

    I can connect to the sessions using startCMSSession() all is ok but when you move to a new page you loose the session data.
    I know the session id number session_id() is consistant as I have output it as a debug.

    I conducted one last test - I started a new session and got a new session id for it.
    The choices were all perfectly remembered between pages but I had to update my "choice list" which was then displayed correctly by the ajax script that started the new session.


    please can anyone suggest how to prevent the manager from loosing my sessions data between pages.
    I have spent too long trying to figure this out and desperately need to move on to complete the project ASAP.

    Any help greatfully received.... wink

    regards and thanks in advance

      • 20413
      • 2,877 Posts
        @hawproductions | http://mrhaw.com/

        Infograph: MODX Advanced Install in 7 steps:
        http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

        Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
        http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
        • 19646
        • 31 Posts
        Thanks for your help.

        It was kind of you to read and answer my question.

        However my variables are stored in a class object which MODx seems to loose when it refreshes the page.
        If I begin a new session then I have all the data in the class object written back to the page.

        If I just use the manager session then it fails to find the class object.

        Can anyone help explain why this is happening or what I am doing wrong. undecided

        regards

          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Are your front-end and back-end using the same domain (www.domain.com vs domain.com)?
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 19646
            • 31 Posts
            hi sottwell

            yes i am using same URL for both
            if you would be agreeable i’ll explain more in a PM.
            I don’t wish to be seen as ’secrative’ but I trying to take care with how much I post up.
            I really don’t want to raise any expectations in the community about what I am building but am going to make it available when its completed and hopefully it will be of use to lots of people.

            If you could help me a bit with this sessions issue your expertise would be so appreciated

            regards

            Steve