Persist state data in angular without using LocalStorage when refreshing page

Discussão em 'Angular' iniciado por Gabri, Fevereiro 21, 2025.

  1. Gabri

    Gabri Guest

    I'm trying to make a webpage that shows different content depending on the type of user (teacher or student). I was saving the session data inside localStorage ('student' or 'teacher' string) because if i save the data inside a service when the page is refreshed the data is deleted.

    The problem is that any user can change the data from localStorage from their browser (for example a user can see the teacher content if they change the value inside localstorage from student to teacher and refreshing the page).

    I know i'm probably doing it in the wrong way by saving the data without encryption inside localstorage but i wanted to ask if there is a better option to achive what i'm trying to do.

    Continue reading...

Compartilhe esta Página