11
I have a form where I can change things like username
, password
, morada
, etc.
On the site I also use a session (login) for each user, which is defined by username
.
The problem is that by changing the value of the username
he is no longer equal to username
of the current session, causing the login to stop working.
Is there anything I can use to detect the change in username
, to redirect to the login page again and display an alert saying "Username changed, log in again"?
By changing the
username
you can also change the value of the current session so you no longer lose the session.– Jorge B.
Or use Javascript that detects the change and already redirects in real time
– Walter Gandarella
Provide some code snippet for the answer
– Victor Eyer