Memory App
 




Session can be started from your script.

<?php
    session_start();
?>
Also, you can start session automaticaly in php.ini

    session.auto_start = 1
    ; no need to include session_start() in every script
    ; session is started before loading classes and makes storing objects in the session impossible
For accesing date we use $_SESSION.

<?php    
    // Set a session variable
    $_SESSION['hide_menu'] = true;
    
    // From here on, we can access hide_menu in $_SESSION
    if ($_SESSION['hide_menu']) {}
Sessions are used to create persistent client state between request. Sessions are stored on servers, cookies on clients. In the interest of security, it is a good idea to follow your call to session_start() with a call to session_regenerate_id() whenever you change a user's privileges to prevent "session fixation" attacks.

Questions
0/0 (80)  
Not Logged