To better understand this function you should execute this code first :

<?php
// First of all choose your path , For e.g. C:/session
session_save_path('Your Path here !');

session_start();

// 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 :

<?php
// Choose the path that you used it in first part
session_save_path('Your path here');

session_start();

// If you want to close session and keep your original data in your path , you should use session_abort()
session_abort();

var_dump(session_status()== PHP_SESSION_ACTIVE);

// Output : bool(False) , it means your session closed .
?>

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 stockwfj3 的頭像
    stockwfj3

    程式設計@筆記

    stockwfj3 發表在 痞客邦 留言(0) 人氣()