NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Johan de Klerk on March 25, 2021, 01:27:31 AM

Title: Can sessiontimeout be set for different pages
Post by: Johan de Klerk on March 25, 2021, 01:27:31 AM
Hi Bruce,

C10 & NT11.50 question.

I have my sessiontimeout set to 5 minutes.

There are some pages (some requiring being logged in and some not requiring being logged in) where lots of information is required and the users sometimes needs to go and lookup the details.
By the time they have the information the 5 minutes has expired and the session deleted.
On these specific pages I would like to make the sessiontimeout = 15 minutes or even longer but not interfere with the rest of the application/users/pages 5 minute sessiontimeout.

Is this possible?

Regards

Johan de Klerk
Title: Re: Can sessiontimeout be set for different pages
Post by: Bruce on March 30, 2021, 01:14:01 AM
In NT 12.12
as long as you have the client-side session manager activated (typically in the footer procedure)
and the user is logged in, and _not_ on the default page,

you can do

p_web.script('$("#counter").ntsessionmanager("setTimeOut","140");')

where 140 is the number of seconds you want the session to be alive for.
140 is more of a "guide" - it will always round up to a multiple of the server-side-timeout value.
So if your server side timeout is say 5 minutes, this effectively sets it to 5 minutes, 10 minutes, 15 minutes or whatever.

cheers
Bruce

Title: Re: Can sessiontimeout be set for different pages
Post by: Johan de Klerk on March 30, 2021, 04:01:28 AM
Hi Bruce,

Thanks for the good news for NT12.

This will help if I upgrade my apps from NT11.

One more question.

Can it be made to work if the user is not logged in and goes to a page where no login is required?

Regards

Johan de Klerk
Title: Re: Can sessiontimeout be set for different pages
Post by: Bruce on March 30, 2021, 06:35:01 PM
yes, as long as it's not the default page.
Title: Re: Can sessiontimeout be set for different pages
Post by: Johan de Klerk on March 30, 2021, 10:11:59 PM
Hi Bruce,

You are the man.

Thank you very much.
This is going to make live so much easier for me.

Regards

Johan de Klerk