R
R
Ruslan Dzh2019-02-08 15:31:52
Node.js
Ruslan Dzh, 2019-02-08 15:31:52

Session problem when refreshing the page in the browser (F5), how to solve the problem?

Good day!
There is a site on vue, more precisely on vuetify. Implemented a simple authorization for one user, who, after entering the login and password, goes to a specific address, which in turn is visible only to the authorized user. Whether the user is authorized or not, done through Vuex (state), the problem is that everything works exactly until I press f5, after which the user is not logged in. How can this problem be solved? Tried writing to session, browser cache to no avail. Thinking of trying to write some information in Reddis or Mongo and check it, is it correct to use this option?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Medin K, 2019-02-08
@medin84

In the backend, store in the session or somewhere else.
In the backend, add a "handle" by which you get the current state of the user name, other user data.
When loading a vue application, pull the handle and set your state.

K
Kirill Romanov, 2019-02-08
@Djaler

local storage

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question