We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31246 ☆ A M B ☆
    • 428 Posts
    My question is with me.
    How do I get for example the events OnWebPagePrerender, took place in the table updates Sise session.
    Time I update for example:
    if ($modx->event->name != 'OnWebPagePrerender') return ;
    if(isset($_COOKIE['PHPSESSID'])){
      $ses = $modx->getObject('modSession',array('id'=>$_COOKIE['PHPSESSID']));
      if($ses){
        $ses->set('access',strtotime("now"));
        $ses->save();
      }
    }

    I see that in the table updates, answers session class modsessionhandler.class.php, but I can not figure out how to make it perform?
    How to update the column data? I need to upgrade, I knew to what context is this session. [ed. note: valikras last edited this post 14 years, 9 months ago.]
      Valentin Rasulov - Industrial design (Hobbies - Web Development)
      Development not standard projects on CMF MODx Revolution.
      Small sample of extensions
      • 22303 MODX Staff
      • 10,725 Posts
      You NEVER update the session table. That would be like writing to the PHP session files if you configured MODX to use the default PHP session handler.

      All you need to do is set the $_SESSION variable value you want, as you would in any session-enabled PHP application, and it will be written to the session automatically.
        • 31246 ☆ A M B ☆
        • 428 Posts
        Thanks @opengeek that sent me the right way! And then, I have not looked for it .....
          Valentin Rasulov - Industrial design (Hobbies - Web Development)
          Development not standard projects on CMF MODx Revolution.
          Small sample of extensions