NetTalk Central

Author Topic: sending them back to the login screen...  (Read 3187 times)

robirenz

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
    • Email
sending them back to the login screen...
« on: May 11, 2009, 06:12:28 AM »
I have an netwebserver app, but I have found a bug that I need to clear.
I usually write in the database the user that logged in the database.
I do this by priming my origin field with p_web.GetSessionValue('user')
however I have found that sometimes that field is blank in my database
My theory here is that the session has expired and so therefore the variable I getting is blank now.
so I added this line in the "only serve if" part of the template...  p_web.GetSessionValue('user') <> ''
however I'm kind of stumped with the "cannot server page" page..  I would rather the system send me back to the login screen,

how could I do this, or is there an option in the templates to be able to do this automatically..

Best Regards...

Roberto Renz

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: sending them back to the login screen...
« Reply #1 on: May 11, 2009, 09:28:10 PM »
Hi Roberto,

If the user needs to be logged in to view the page, then rather just tick the "must be logged in" option on the advanced tab. That's a lot easier than entering
p_web.GetSessionValue('user') <> ''

And it'll work better since it has built-in functionality to redirect users to the login screen.

If you want a fast way to set this, go to the Properties of the WebHandler procedure, and you can select the "must be logged in" procedures on a list.

Cheers
Bruce