I'd like to do a little data mining, to see if any of my customers are giving out their username/password.
Q: What info can I get about the PC that the person is on?
- Their IP address (presuming it's fairly static)
- Their Browser (presuming they're not ha开发者_开发百科cking the cgi scope)
- Their screen resolution
- Their cookie scope (presuming they have cookies turned on)
What else?
I want to see: "Hey! This person is logging in from three different machines!"
See here (plus comments):
http://www.coldfusionjedi.com/index.cfm/2010/11/5/Ask-a-Jedi-Preventing-logins-from-other-machines
Most of that is in the CGI scope:
<cfdump var="#CGI#">
Exactly what will be in there is determined by which Web server you're using (e.g. IIS, Apache, etc), and will vary from server to server.
Example: CGI.REMOTE_ADDR is one of the variables that might contain a usable IP address of the client.
CGI.HTTP_COOKIE may contain all of the cookies from the browser, URL-encoded. You can also dump the Cookie scope:
<cfdump var="#Cookie#">
To get screen resolution I think you'd need to use a JavaScript or Flash solution - maybe even CSS; I recall something about being able to serve different CSS files based on screen size for mobile devices. Maybe in Modernizr? http://www.modernizr.com/
精彩评论