Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stateStorageStrategy localStorage does not increase session counters #718

Open
christoph-buente opened this issue Mar 29, 2019 · 6 comments

Comments

@christoph-buente
Copy link

commented Mar 29, 2019

We are looking into changing the stateStorageStrategy from cookie to localstorage. The current mechanism to detect a new session is the absence of the _sp_ses cookie which expires after the configured sessionCookieTimeout. The problem is, that localstorage does not have an expiry mechanism, so the the _sp_ses.xxxx key in local storage stays forever.

The timestamps are properly written to the _sp_id.xxxx key in local storage. And the timestamps are actually enough to detect a beginning of a new session. If current timestamp and last visit time stamp are longer apart from each other than the session duration, the counter could be incremented.

And then we could get rid of _sp_ses cookie/localstorage key.

What do you think?

@christoph-buente

This comment has been minimized.

Copy link
Author

commented Apr 8, 2019

@mhadam any thoughts?

@mhadam

This comment has been minimized.

Copy link
Contributor

commented Apr 10, 2019

Hi Christophe! That seems reasonable, and no problems really occur to me at first glance. I’ll try to get this in a new release within the next couple weeks.

@christoph-buente

This comment has been minimized.

Copy link
Author

commented Apr 18, 2019

Thank you!

@grzegorzewald

This comment has been minimized.

Copy link
Contributor

commented Jul 30, 2019

The issue has been addressed at Snowplow forums (https://discourse.snowplowanalytics.com/t/session-not-tracked-correctly/3026). Can it be prioritized @alexanderdean ? Especially as it seems to be slight workaround for ITP2.2.

@goodits

This comment has been minimized.

Copy link

commented Jul 30, 2019

Hi @grzegorzewald we can take a look at this next week and get back to you!

@christoph-buente

This comment has been minimized.

Copy link
Author

commented Jul 30, 2019

Thanks Steve, much appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.