Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6794855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:16:20+00:00 2026-05-26T18:16:20+00:00

I have been given a homework assignment where I need to create a captcha

  • 0

I have been given a homework assignment where I need to create a captcha to login to a ‘comments’ section.

I have the captcha working fine, no problem. We are also tasked with keeping count of failed attempts at the captcha. No problem.

Here IS my problem. We are told that the user is allowed to try as many times as he or she wishes, however, if they fail 5 times within a thirty second limit, they are locked out for three minutes.

I understand how to track 5 missed attempts, but how would you track the timing on this one? If the user tried 4 times in 15 seconds, and then waited for a minute (or less, obviously), the clock is reset, and they have 5 more tries. Furthermore, if they tried twice and waited 30 seconds, the attempts would try again.

Do I need to set a time cookie, a secondary count cookie (to go along with the original count cookie), and track the start of the secondary counter and just see if that counter increments to 5? How would you do this?

EDIT:

Have to apologize, apparently I was not completely clear on my situation. In this homework assignment, it is strictly stipulated we must use cookies to accomplish this task. We are not looking at best practice or security at this point, the instructor simply wants us to be comfortable with cookies. Unfortunately, session is not an option for me, I must use cookies.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:16:21+00:00Added an answer on May 26, 2026 at 6:16 pm

    Given you’ve tagged this as PHP, simply start a session with session_start(). That gives each user a unique ID via a cookie, and you can store their login attempts in the $_SESSION array on the server. At each login attempt, you can check the recorded attempts stored in the session and see if they exceed the allowable attempt rate.

    Of course, the usual warnings hold: On a real security system, an attacker would be highly unlikely to maintain that session cookie over their many attempts – they’d ignore it, forcing a new blank session to be created each time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been given a requirement where I need to support multiple databases in
I have been given the tasks of speccing a mobile application, which will need
I have been given an assignment to drop one of our product's dll and
I have been given an old dll and the assignment of accessing it through
I have been given a problem to decrypt this text: 3e47b75000b0924b6c9ba5759a7cf15d which is supposedly
i have been given a project where i will need to write code such
I have been given a project where i need to write a program which
I have been given two different Microsoft Word document that my virus scanner has
I have been given a DLL (InfoLookup.dll) that internally allocates structures and returns pointers
I have been given the task of internationalizing a large client-server application. The remit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.