(PHP 5 >= 5.6.0, PHP 7)

session_abortDesecha los cambios en el array de sesión y finaliza la sesión


void session_abort ( void )

session_abort() finaliza la sesión sin guardar datos. Por tanto, se mantienen los valores originales de los datos de la sesión.

Valores devueltos

No devuelve ningún valor.

Ver también

add a note add a note

User Contributed Notes 1 note

parsa dot mhn at outlook dot com
2 years ago
To better understand this function you should execute this code first :

// First of all choose your path , For e.g. C:/session
session_save_path('Your Path here !');
// Define a Session Variable
$_SESSION['Key'] = 'value' ;
Var_dump(session_status() == PHP_SESSION_ACTIVE);
// Output : bool(True) , it means you have an open session !

Then you should execute this code :

// Choose the path that you used it in first part 
session_save_path('Your path here');
// If you want to close session and keep your original data in your path , you should use session_abort()
var_dump(session_status()== PHP_SESSION_ACTIVE);
// Output : bool(False) , it means your session closed .

So if you have an open session , session_abort() will simply close it without effecting the external session data , so you can reload your data again from your path that you chose .
To Top