0
I’m trying to close a sessão
php
and redirect a user after password exchange to force new login
on the return of an action, the redirect is taking place but I don’t know exactly how to end the session at this time.
What I have in return for the password change is this:
if (response.codigo == "1") { $("#msgResultadoSenha").html('×AVISO!' + response.mensagem + ''); // Atualizando os dados do formulário window.location.href = "index.php#ajax/iPerfil.php"; } else { $("#msgResultadoSenha").html('×ATENÇÃO! ' + response.mensagem + ''); }
A specific session or all created?
session_destroy()
eliminates all sessions of that user.$_SESSION['nom_ses'] = ''
makes the session receive empty and so "deleted". As you are planning to do?– Don't Panic
Hello @Everson, as I said in the question, the session I want to end is that of the process that validates the user, as I am planning to do is Jquery + php.
– adventistapr
Yes, but for example, you changed the user password in PHP and returned to JS, but could already destroy the sessions after changing the password and then just redirect. Just an idea, if it’s not the way you need it, let’s wait for other users to show you other solutions.
– Don't Panic
Great idea @Everson, was stuck on this issue, already gave me a great direction.
– adventistapr