Skip to content

Add userId as a cookie in @baselime/react-rum #6

@eskaTech

Description

@eskaTech

Description:

I have recently integrated @baselime/react-rum into our project and noticed an issue with the setUser function. The current implementation does not store the userId in a cookie, which results in the need to call setUser on every page reload. This becomes problematic, especially if an error is thrown before the setUser function is called, as the userId is not included in the request.

Proposed Solution:

  1. Store userId in a Cookie:

    • Similar to the baselime-session-id, store the userId in a cookie. This will ensure the userId is retained across page reloads and available in subsequent requests.
  2. Function to Remove userId on Logout:

    • Provide a function to remove the userId cookie when the user logs out. This will ensure that the userId is not retained once the user has logged out, maintaining security and privacy.

Implementing these changes would enhance the reliability of @baselime/react-rum in managing user sessions and improve the overall developer experience.

What do you think about this proposal? Have I missed anything that might already address this issue?

Thank you for considering this enhancement.

Regards,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions