Currently we have a concept of
ud cookie, which internally stores currently logged in user’s ID, and session id.
Realm itself doesn’t know what those IDs represent, it treats them as opaque strings. This is after we implement activity store. Currently we only know of
What is user id? Its the id you want to use to represent your user. Depending on your website you will have auto incrementing primary key as id, a guid, or maybe even the username.
Similarly, if a user is logged in on multiple devices, it would be good to keep each activity grouped by the device. For identifying the device we can use user-agent etc, but they are no unique, so simplest thing is to drop a session id. Session represents a login/logout session, is created when user logs in, is destroyed when user logs out.
What is a visit? When a visitor on your site visits, say I am a logged in user, or maybe anonymous user, and came today at 8AM, and was on site for next 15 minutes, browsing around, whatever, this is one visit. If I keep coming within 30 mins, it will keep extending the visit. But if I drop off for 30 mins, say come back again at 9AM, this would be considered second visit.
What realm will do as part of this proposal is to generate a unique id (guid maybe), and set it as visit_id cookie in browser, with an expiry of 30 mins. If any http request comes with that cookie, meaning the cookie did not expire, the expiry of cookie is set to
now + 30 mins on every request.
The value of visit would be available in activity.
What is tracker? Purpose of tracker is to uniquely identify the browser. Say you made 10 visits from a device before you signed up, it would be good to know this.
Realm will generate a unique id, and set it as
tracker_id cookie, with infinite life. The value of this cookie would be available in activity.
We’ll generate and set these cookies if not present (honouring visit expiry), and log them as part of activity logging.
Realm is extremely privacy concerned. And this tracking, is done as a step to improve privacy consideration.
First of all these features can be switched off in realm by setting an environment variable (
Further, if we do not have a privacy protecting solution to answer simple questions eg how many people visited my site today etc, people will resort to analytics companies, who are extremely privacy invasive.
rustfmtFor Some Section