www.webdeveloper.com
Results 1 to 6 of 6

Thread: How to block users with dynamic IP's?

Hybrid View

  1. #1
    Join Date
    May 2012
    Posts
    4

    How to block users with dynamic IP's?

    I've got a problematic user I need to block from my site. And while I know I could use .htaccess, I'd prefer to adopt a blocking strategy that would account for the possibility of the user's IP address changing.

    I imagine something like: Assigning a cookie if the IP address in question appears, then banning the cookie. Perhaps I could give my site enough time to assign the cookie and then implement .htaccess. But I realize this approach could be quite crude.

    So I'd welcome feedback on how to go about this.

    Thanks!

  2. #2
    Join Date
    May 2012
    Posts
    4
    If there's a way to use a cookie and .htaccess as the backup (in case the user's cookies are turned off), that seems like the preferred way to go. But I believe .htaccess would prevent assigning the cookie in the first place.

    I want the functionality of the cookie in case the user take his laptop to another site.
    I want the functionality of .htaccess in case the user has turned off cookies.

    Thanks again!

  3. #3
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,648
    i case this is a registered user who has his username and password i would try to block that username's ability to post
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

  4. #4
    Join Date
    May 2012
    Posts
    4
    Thanks, Padonak. (When I first read your post, I thought you were saying that my ability to post to this site should be blocked.)

    However, my site doesn't require a user login.

  5. #5
    Join Date
    Mar 2007
    Location
    U.K.
    Posts
    1,127
    Store a localStorage string on his machine. He's less likely to notice it than a cookie. You can use it to identify him and update his stored IP address.
    Where used, return should be executed unconditionally and always as the last statement in the function.

    That's my signature, it's not part of the damn post!

  6. #6
    Join Date
    May 2012
    Posts
    4
    Thanks! I'll look into that!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles