Modify Login DEMO to timeout back to Login page

Issues related to hyperlinks and web site navigation.
Forum rules
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/links.html
Post Reply
jmibarcodes
 
 
Posts: 7
Joined: Sun Jul 20, 2014 8:52 pm

Modify Login DEMO to timeout back to Login page

Post by jmibarcodes » Sun Oct 07, 2018 9:30 pm

I have been playing with the "Login" template from the DEMO set of templates in order to better understand how the protected page stuff works. So far, I have been able to get it to do what I want. The only thing I still have nagging is to get the "protected_page" to automatically timeout after a set period.

I want to use the template as the beginning of a small project where salesmen can look up stuff from a CSV file online. However, salesmen being their normal selves, will always take the lazy way out and leave themselves logged in all the time. So this could create a problem when they walk away form the pc terminal and leave the otherwise secured information open to the general public.

Since their information will only take 1 to 2 minutes to be found and viewed, I wanted to make the protected_page timeout after 180 seconds. I have tried playing with the php timeout function that seems to be in the page code, but I either completely break the page or is does nothing.

Would anyone here have been down this path before and be able to shed some light on the easiest way to accomplish this?

The only thing I am sure of is that I need to force an action just like the "Logout" button would have done if the salesman had used it.

Thanks in advance for any insight you may be able to provide :)

User avatar
Pablo
 
Posts: 14099
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Modify Login DEMO to timeout back to Login page

Post by Pablo » Mon Oct 08, 2018 5:57 am

You can set the session timeout in the 'Login' object.

jmibarcodes
 
 
Posts: 7
Joined: Sun Jul 20, 2014 8:52 pm

Re: Modify Login DEMO to timeout back to Login page

Post by jmibarcodes » Mon Oct 08, 2018 11:50 am

HI Pablo,

I saw a "timeout" in there that was force set to = 0

But I didn't see it anywhere else. In order to use it, doesn't it require another call of some kind to turn it on and then another one to check if it reached zero yet?

I have never used the function I saw in there before. I have always just used a meta redirect but that is not the right way to exit a secure area so taking the logout action is what I couldn't figure out.

BKM

User avatar
Pablo
 
Posts: 14099
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Modify Login DEMO to timeout back to Login page

Post by Pablo » Mon Oct 08, 2018 12:28 pm

If you set the timeout to 0 then the session will not timeout, and the session will only end when the browser is closed.
https://www.w3schools.com/php/func_http_setcookie.asp

Note that the page will not close automatically after the timeout, only new requests for the page will be blocked (on the server side).

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests