How to work with sessions

How to start a session

Start a session with the default cookie parameters

      session_start();
      

Start a session with custom cookie parameters

       lifetime = 60 * 60 * 24 * 365; // 1 year in seconds 
       session_set_cookie_params($lifetime, '/'); 
       session_start();
      

Description

Back