Datatable Editor Check PHP Session timeout

Datatable Editor Check PHP Session timeout

YoDavishYoDavish Posts: 123Questions: 46Answers: 3

Hello,

I'm using Editor 1.9.4.

Is there a way to check the PHP session.gc-maxlifetime which by default is set to 1440 seconds (24 minutes) to see if the time has expired or session no longer exist then redirect the page when a value is edited in a column?

Answers

  • YoDavishYoDavish Posts: 123Questions: 46Answers: 3
    edited November 2020

    I found a solution after more digging around. By adding error: function to my ajax call I'm able to alert the user and redirect them back to a login page. Code below:

                    ajax: {
                        url: "tableServer-page.php",
                        error: function (xhr, error, thrown) {
                            alert( 'Session has expired. Please login again.' );
                            window.location = 'login.php';
                        },
                    },
    
  • allanallan Posts: 61,726Questions: 1Answers: 10,109 Site admin

    Yup - spot on. Thanks for posting back.

    Allan

This discussion has been closed.