Trying to figure out how to identify unique users properly with cookies and perhaps coupling that with the public IP.
What’s the suggested path to follow in this regard? (I’m open to a standard Rails method or leveraging another Ruby Gem if that’s more elegant.)
On the topic of cookies, which is the proper way to retrieve client cookies in Rails 3.x+? I have been using cookies, but it seems that request.cookies also works. What is the difference / preference when using these two? I’ve seemingly seen request.cookies fail in some instances; but perhaps it was after clearing out the cookies for the app prior to refreshing and working with it in the console.
Also, do cookies have a unique ID that can be utilized to identify clients uniquely?
Essentially my goal is to count visits per unique visitor to a site. I am assuming I will need to compare a unique cookie ID and perhaps an IP, but I’m not sure what would be most kosher in this situation.
Ultimately I need to to understand how to uniquely identify visitors of the site and then store them in a count or number of visits to the site for that visitor.
For your question on the difference between
cookiesandrequest.cookiesseehttp://www.quarkruby.com/2007/10/21/sessions-and-cookies-in-ruby-on-rails#scvr
It’s well explained.