The php session time out has expired

Is it possible to re-rout to login page when the seesion expires. it give an error like message and clients gets terrefied by this message.

seesiontimeout.png

This should help: Scriptcase - Configuring the Session Timeout: http://www.scriptcase.net/scriptcase…ar_en#lightbox

The video
https://youtu.be/bpR7BTI8n4s

You can also try increasing your session timeouts in SC, php.ini or mysql.ini

I opted for a more elegant jquery script, google Jquery-idleTimeout
I adapted this script for my applications: https://github.com/thorst/jquery-idletimer

You can use modal dialogs to first give the idle user the chance to stay logged on, and then time-out to force the user to logon again: [ATTACH=CONFIG]n72861[/ATTACH]

Remember that this does not control the actual php session object , so your actual php session may still be active when the jquery session timer forces you to logon again so session variables may still have values, if you want you can experiment with destroying the session by redirecting with a query string eg. login.php?logout=1 , then when the logon page receives the parameter write php code to manipulate the session object. Note that destroying the session when testing in the SC Dev environment will destroy your SC development session and you’ll have to logon to SC again.

logout.png

1 Like

@leonvz Hey mate,

Thanks that’s helpful.

Always a pleasure

Hi Leonvz, Thank you very much for this tips, do you have any sample sc_application that uses this. What I am not be able to understand is which event I need to call this JQuery? I assume I need to call this in every application. So may be I need to create a common function and call that function on all application. Any tips on this will be very helpful.

Hi Leonvz,

I have downloaded the code from https://github.com/thorst/jquery-idletimer and tried to run the demo , there are some errors in JQuery in my site but in their demo site everything works very well and I even copied that index.html from the demo site and jQuery contents to my site but still I am having issues. I don’t know how can the same code work in one site and don’t work in another site. See the error attachment when I did inspect element.

Their production demo site working without any issues : http://thorst.github.io/jquery-idletimer/prod/demos/

The same code from my site having issues : https://my-society.org/home/jquery-idletimer-master/demos/index.html

Any help here would be greatly appreciated. Thank you very much.

timeout_demo_error.png