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.
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.
i case this is a registered user who has his username and password i would try to block that username's ability to post
signature under construction
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.
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!
Thanks! I'll look into that!
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)