We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24629
    • 370 Posts
    Hi All,
    I want to create a polling functionality for a site i'm working on. I want to store all answers in the DB (used Bobrays ecxellent custom db tutorial to set up the table) and i want to use the Session ID to prevent people from sending in multiple answers in rapid succession.

    Now can anyone tell me:
    - Is the session ID a unique number?
    - is
    in a snippet the correct way to retreive the sessionid?
    - when will a sessionid be different for the same 'browser / user' . So when someone refreshes the browser will there be a new sessionID? or when they come back the next day?

    • I wouldn't personally rely on the session_id like that. Instead, just store some information in the $_SESSION for your purpose. MODX will keep the session filled, even if the session_id changes.
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 24629
        • 370 Posts
        I don't understand. Are you saying MODX will store session variables and is able to retreive them even if the sessionID changes?
        how can MODX know which user/browser is used without a sessionID?
        And ho long will it take before modx will 'think' the user is a new user?