Add support for recording state in localStorage rather than cookies
See original GitHub issueThis is to help minimize overall HTTP header size.
Most servers only allow up to 4kb (Akamai default); some will bump this to say 16kb but this can still not be enough for some user’s accumulated cookies on one request. Having such big HTTP headers increase the total size of all upstream requests and binds a lot of memory on server requests and therefore reduces the number of possible concurrent connections.
We have future proofed our client_session schema to record where the session is stored: https://github.com/snowplow/iglu-central/blob/master/schemas/com.snowplowanalytics.snowplow/client_session/jsonschema/1-0-1#L33
So hopefully it is not a huge change to support this? The only note is that we should add a new Tracker Protocol parameter (maybe we won’t flow it through Snowplow right now) to track what storage we are using for this session, so that:
- we can fully back-populate
client_session
s contexts from TP parameters when we finally switch to usingclient_session
for web - if a user switches the storage, we have a theoretical way of untangling changing session identifiers (because they won’t survive the switch) (theoretical because if we don’t represent the new param in atomic.events, it will be very hard to review)
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (7 by maintainers)
Top GitHub Comments
This affects us as well, as we’re using the Javascript SDK inside Ionic / Cordova. We have a heavy problem with duplicated first sessions across users on mobile, as cookies apparently don’t stick:
Changed the title to prevent confusion between recording state and tracking events