Session Timeout - Change Default Message

When the user’s session times out, this message is displayed in a box (or some variation of it, sometimes mentioning sessions variables).

Unable to connect to the database: The php session time out has expired or the connection parameters are incorrect.

This is not user friendly. At all.

Is there a “nice” way to detect a session timeout and, preferably redirect the user back to the login app?

If this is not easily achieved, can these messages be changed/configured to say something less technical and more user friendly? For example, “Your session has been idle for too long. Please close the browser tab and login again. Thank you.”

Regards.

Maybe you’re looking for the macro:
sc_apl_default(‘application’, ‘type’);

There is also a tutorial for it:

Hope this will help.

Gunter Eibl

Thank you for the tip, Gunter. That certainly seems to be what I am looking for. I’m not sure why I have not see it before. I’ll have to do some testing with it.

Some questions though:

  1. I have a multi-application solution running in tabs. From the limited documentation I’ve seen (macros doc), it seems to suggest that I only need to call this once (for example, in the Login app) and it has global scope, that is, applies to all the apps for that session… is that correct? In other words, I do NOT have to put this macro in every onApplicationInit event in every app in my solutions, right?

  2. With the “M” option (display message), where is the message defined? Can it be customised?

  3. Less important for me now, but I didn’t really get the purpose behind the reset macro. Does that just reset to the SC default behaviour? Why would you want to do that?

The examples don’t give you a lot of insight regarding the intentions for use.

Regards, Russell.

P.S. I found the text of the default SC messages, which you can change…
Locales > Application Language > (left-hand pane) > Scriptcase Messages > Validation. But it is not clear if it still uses these messages when you select the “M” option or if the message is defined somewhere else.

Hello Russel,

I never did get deap enough into this. A collegue/customer did use it.

Regarding:

  1. Yes, you have only to use it once if you want. You can find the functionality in some Scriptcase Security modules, which you can get generated.

  2. Don’t know. Maybe you can try :wink:

  3. Reset can be important, if you want to switch back to the standard behavior, i.e. just a PHP message of timeout.

And yes, the documentation on ths is not very excellent :frowning:

Sincerely
Gunter Eibl