Invalid form state data. Session Expired.

Login or register to post comments
4 replies [Last post]
Offline
Joined: 10/11/2010

Hello all,

I after quite an effort created the ajax control I wanted to and it works as expected. However, there is a problem:

At times, clicking the 'Details' button which actually does a QAjaxAction comes up with a pop up saying "An Error occurred during AJAX response parsing, error details willl appear in a new pop up". The new pop up shows up the kind of error page with the stack trace and code which I am accustomed to now, after using QCubed for development since a month. The pop up says this:

Invalid Form State Data for "products" object (session may have been lost)

I have noticed that the error appears mostly after a browser restart or a sleep / hibernation resume or at times when the browser is left open in the background and I return to it after an hour or so.

However, the small app I am trying to develop is someday expected to see the light of the day as a real website and I do not want to show that message to the visitors, or the code snippet. I simply do not want that "Form State Data" to get invalidated.

Of course, the intent of the error message is good - to tell what went wrong. But is there some way to prevent it from happening?

Thanks.

Offline
Joined: 10/11/2010

No one knows about this problem? :(

Offline
Joined: 03/31/2008

I am having the same problem since upgrade from QCodo -> QCubed 2.0.2

Steven Warren's picture
Offline
Joined: 11/06/2008

To display friendly error messages un-comment the following lines in configuration.inc.php:

// To enable the display of "Friendly" error pages and messages, define them here (path MUST be relative from the DOCROOT)
define('ERROR_FRIENDLY_PAGE_PATH', __PHP_ASSETS__ . '/friendly_error_page.php');
define('ERROR_FRIENDLY_AJAX_MESSAGE', 'Oops!  An error has occurred.\r\n\r\nThe error was logged, and we will take a look into this right away.');

As for your session expiry issue, you may want to look at this forum post http://stackoverflow.com/questions/520237/how-do-i-expire-a-php-session-after-30-minutes.

Offline
Joined: 10/11/2010

Well, thanks for pointing me to the page as well as at configuration.inc.php.

Do you think changing

define('__FORM_STATE_HANDLER__', 'QSessionFormStateHandler');

would make a difference in the way sessions are expiring , or precisely get rid of the error message?