NetTalk Central

Author Topic: Login Attempts  (Read 3603 times)

broche

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Email
Login Attempts
« on: April 13, 2014, 07:33:55 AM »
Hi, Trying to track the number of login attempts by a user so that I can shut them out after more than 3 attempts.
Tried with a local variable Loc:Tries and added 1 each attempt but I'm sure I didn't do it the web way as it odesnt want to increment the variable.
Should I be setting a session variable in some way?

Any suggestions?
Brian

debzidoodle

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
    • Email
Re: Login Attempts
« Reply #1 on: April 13, 2014, 12:33:22 PM »
I think to actually lock someone out you would have to have a flag in their user record that indicates a lock out so that they cannot just go to a new browser and start up a new session.  But to count your session attempts you would probably have to use a session variable to store those attempts.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Login Attempts
« Reply #2 on: April 13, 2014, 10:59:34 PM »
>> Should I be setting a session variable in some way?

yes,
p_web.SSV('tries',p_web.GSV('tries')+1)

but of course this is only "tries this session". If they close the browser, and start again they'll get a new session, and hence 3 more tries.

If you want to count the tries across sessions then you'll need to add a field to your users table. But then you'll need some manual, or timed, reset so that a locked user can be unlocked.

Cheers
Bruce

broche

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Email
Re: Login Attempts
« Reply #3 on: April 14, 2014, 06:57:08 AM »
Thanks all, I like the staff record idea.
Brian