- PHP session is used to store and pass information from one page to another page temporarily until the user closes website.
- In shopping website PHP website is widely used where we need to store and pass cart information from one page to another.
- For example. username, product code, product name, product price etc.
- The session creates unique user id for each browser to recognize the user and avoid conflict between multiple browsers.
- PHP session_start () function is used to start the session and starts new and resume existing session.
- If session is created already then it returns existing session and if session is not available, it returns and creates new session.
- It is an associative array that contains all session variables and it is used to get and set session variables.
W