PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 2024 → Webdev Session Time-out. How to increase the time of session?
Webdev Session Time-out. How to increase the time of session?
Débuté par Meghana, 11 avr. 2017 07:31 - 6 réponses
Posté le 11 avril 2017 - 07:31
Hello Everyone,

I have developed one webdev application. while deployment I have set the session time as 1 hour. But after login session get shut down after 600seconds. Due to this issue we have lost the data which we enter on screen and not saved during session.

I want to keep the session open atleast for 1 hour. Can anyone help me on this?

How I can set the time for session time-out?

Thanks in advance.

Regards,
Meghana
Posté le 11 avril 2017 - 15:26
Hi

the easiest way to do that from your project, without having to change
time out settings on the server, is to write a KeepAlive function. THis
is how it's done:

- in the page template, you add a timer (browser side) with the timersys
function. You can set a time of 5mn by example.
- in the procedure called by the timer (browser side), you do an
ajaxexecuteasynchronous of a server side procedure
- this server side procedure does NOTHING by code, but the simple fact
that's it's called every 5 minutes reset the time out counter on the
server side

Because you coded that in the page template, all pages using it will do
this and stay alive for as long as they are open...

However, you may want to implement some sort of sandbox system
(automatic intermediary saves) in your web site if your user is going to
remains for hours on the same page without saving the data.

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com



Le 4/10/2017 à 11:31 PM, Meghana a écrit :
Hello Everyone,

I have developed one webdev application. while deployment I have set the
session time as 1 hour. But after login session get shut down after
600seconds. Due to this issue we have lost the data which we enter on
screen and not saved during session.

I want to keep the session open atleast for 1 hour. Can anyone help me
on this?

How I can set the time for session time-out?

Thanks in advance.

Regards,
Meghana
Posté le 19 avril 2017 - 12:53
Hello Fabrice Harari,

Thank you so much for your reply.

I have implement what you have suggested and I am successful to add timer on page.
But when the timer is running I can not able to click on any other menus of my page.

I have tried to show you the design of my page as below.

I have main page which has menu bar and 1 frame. What ever menu I have select the respected page opens in that frame.
I have added timer at the header of main page. Now when I tried to click on menus to open any page it doesn't work.

--------------------------------------------------------------------------------------------
00:00:00 <------ Timer
<------ Header of Mainpage
Opt1 Opt2 Opt3 Opt4 Opt5 Opt6 <------ Menubar
--------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------|
|
|
|
| <------- iFrame to open respected
| Menu page
|
|
|
|
-------------------------------------------------------------------------------------------|



Can you guide me on this? Because of your solution I am almost reach near the requirnment.

Thanks in advance.


Regards,
Meghana
Posté le 19 avril 2017 - 14:18
Hi,

Can you guide me on this? Because of your solution I am almost reach
near the requirnment.

As you are not showing me the timer code or a nything related to it, no,
I cannot help

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com


Thanks in advance.


Regards,
Meghana
Posté le 20 avril 2017 - 08:58
Hello Fabrice Harari,

Below are my steps and code to add time on screen

1) I have added one command button (BTN_Timer), 1 static (STC_Timer) on main screen.

2) I declare 1 variab "_ValSTC" as interger under Global declaration of main page
gn_ValSTC is int=0


3) Then I have written LocalProcedure (browser) by name "Automatic_Timer" where I called the execute process of BTN_Timer
ExecuteProcess(BTN_Timer,trtClick)


4) I have writter below code under click action of button "BTN_Timer". On this even I keep the Ajax enabled.
gn_ValSTC+=1
STC_Timer=gn_ValSTC


5) Then Under Page_Load (browser) action I have added below code
GLOBAL
gnIdTimer is int = Timer(Automatic_Timer,10)


I have attahed the screenshot of issue which I am facing.

Kindly guide me as soon as possible.

Thanks in advance.

Meghana


Posté le 20 avril 2017 - 13:20
Hi

Your first problem is that you didn't read the help of the timer
instruction correctly.

as your current code stands, the timer is called every 1/10 of a second.

Your second problem is that you did NOT follow my instructions: you are
not using ajaxexecuteasynchronous

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com



Le 4/20/2017 à 12:58 AM, Meghana a écrit :
Hello Fabrice Harari,

Below are my steps and code to add time on screen

1) I have added one command button (BTN_Timer), 1 static (STC_Timer) on
main screen.

2) I declare 1 variab "_ValSTC" as interger under Global declaration of
main page
gn_ValSTC is int=0


3) Then I have written LocalProcedure (browser) by name
"Automatic_Timer" where I called the execute process of BTN_Timer
ExecuteProcess(BTN_Timer,trtClick)


4) I have writter below code under click action of button "BTN_Timer".
On this even I keep the Ajax enabled.
gn_ValSTC+=1
STC_Timer=gn_ValSTC


5) Then Under Page_Load (browser) action I have added below code
GLOBAL
gnIdTimer is int = Timer(Automatic_Timer,10)


I have attahed the screenshot of issue which I am facing.

Kindly guide me as soon as possible.

Thanks in advance.

Meghana



Posté le 07 septembre 2021 - 13:21
Hello,

Did You get it to work proparly, and if Yes , what were the changes to the code?


Thanks