Closed brijeshbv closed 2 months ago
hey @brijeshbv
that version of posthog-js is from 2023-11-15, can you update and check if the problem still exists.
posthog.register
stores the property in whatever persistence mechanism you have set for the browser. so, it depends what you mean by "browser session". if you're using localstorage+cookie
or cookie
persistence then registered properties will persist longer than an instance of a browser window or tab
Bug Description
Setting any properties to event during registration using the
posthog.register()
API has unexpected fallback mechanisms for users. Expectation: Any event set usingposthog.register()
should last only for the current browser session. If this is wrong, then my bug is invalid.The flag from a previous browser session, is remembered for future sessions even if the event is not set at all in future sessions.
Removing browser cache/history does not solve the issue. I'm assuming the event is remembered based on some backend logic.
How to reproduce
posthog.register()
conditionally on the front-end.Additional context
Client version:
"posthog-js": "^1.91.1",