NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Alberto on April 09, 2009, 01:25:17 PM

Title: Force the user to login
Post by: Alberto on April 09, 2009, 01:25:17 PM
Hi,
For when the app logsout the user automatically I´ve added to some procs the following code:

IF p_web.GSV('login_id')=''
   LoginForm(p_web)
   RETURN
end

It works ok, but...

1- Is there any other way to check the session is out than cheking a session value?

2- If I want to add this code to all my pages except the LoginForm, in which WebHandler embed must I add the code?
I´ve tried in MakePage but weird things happened...

Thanks

Alberto
Title: Re: Force the user to login
Post by: Bruce on April 09, 2009, 11:05:14 PM
Hi Alberto,

you're doing this completely the wrong way.
On every page, browse and form, advanced tab, is an option
"must be logged in". If you tick this on, and the control is called as a page, then it will automatically redirect to the login screen.

If the control is _embedded_ on a page, then the control will be excluded, and no redirect will happen.

To know if a session is logged in use p_web.GetSessionLoggedIn()

Cheers
Bruce
Title: Re: Force the user to login
Post by: Alberto on April 12, 2009, 01:34:20 PM
Hi Bruce,
For some reazon this is not working, I will check it and let you know.

Thanks
Alberto