What is this really?
Does it start a current session based on cookies? Got that from the PHP website. How does PHP control the session? If I start a session when a
You can compare PHP session with the cookie, but session is the much more secure way of storing information. Cookie store data on user's computer, but session store on the server in a temporary file securely. I have discussed session and how to use it on one of my blog post - How to start a PHP session, store and accessing Session data?
Below is an example code of storing data in PHP session:
Below is the example of retriving the session data:
The above code will display the name "John".
Source: How to start a PHP session, store and accessing Session data?