Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

292
Views
How can I hide the userid of a user from the session storage while inspecting?

While storing data in sessionStorage for a react app, I can't hide the user's userid in the browser. How can I do it?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Nothing can be hidden in the browser, regardless of where/how it's stored. The moment something is sent over the wire to/from the client, it is visible clientside.

Consider using something like JWT tokens and a backend server for authentication (alternatively, you can use Firebase, Auth0, or Supabase auth if you don't want to stand up your own server).

With JWT tokens (or essentially, having some form of "access token" for your user's session), you would send these tokens with every API request to the API. The API would then be able to validate these tokens using "secrets" (i.e. encryption related values that only your server knows about to help with decoding and validating these tokens, so no client will ever see it) and confirm your user's session.

about 4 years ago · Juan Pablo Isaza Report

0

You can't hide any data which is sent to the client. In the browser nothing can be hidden.

What you can do is use the JWT token to store the userid in the JWT payload. Whenever any request is made, to the BE you can check if the token is valid or not and if it is valid then you can decode the token and get the user id and use that for further processing.

NOTE: It's a good approach not to send the user id in the request, get from the Auth token.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!