question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for recording state in localStorage rather than cookies

See original GitHub issue

This 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:

  1. we can fully back-populate client_sessions contexts from TP parameters when we finally switch to using client_session for web
  2. 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:closed
  • Created 7 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
falschparker82commented, Oct 27, 2016

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:

Affected users:
90% of all ios users
0,3% of all web users
43,7% of all android users
0reactions
alexanderdeancommented, Mar 31, 2017

Changed the title to prevent confusion between recording state and tracking events

Read more comments on GitHub >

github_iconTop Results From Across the Web

Beyond cookies: Today's options for client-side data storage
While cookies and localStorage are limited to only storing strings, IndexedDB can store any type of data that can be copied by the...
Read more >
How to Use Local Storage with JavaScript - Section.io
This article will cover how to use local storage in a browser with JavaScript. Local storage is a form of web storage that...
Read more >
JavaScript LocalStorage: a Complete Guide
The complete guide on LocalStorage, it's API, a code walkthrough, and various trade-offs and limitations compared to other storage options.
Read more >
Local Storage Versus Cookies: Which to Use to Securely ...
As a web developer, you typically have two options for client-side token storage: local storage (aka localStorage) and cookies.
Read more >
What is the difference between localStorage, sessionStorage ...
Web Storage (session, local) allows us to save a large amount of key/value pairs and lots of text, something impossible to do via...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found