what is the difference between $_ENV , $_SESSION and $_COOKIE

cookies, environment-variables, php, session

Solution

All three are superglobal, that means any script in your application can access it, BUT while $_SESSION and $_COOKIE are different (and private) for each user, the $_ENV superglobal is not specific to a user. The difference between $_SESSION and $_COOKIE is that $_COOKIE can live beyond the current user visit, while the session will end when the user leave your site (or close his browser).

You can find here more good information about session http://www.php.net/manual/en/intro.session.php

Problem

Mostly i have used $_SESSION, But while reading about Session i got few terms $_ENV & $_COOKIE. I am not getting clear about when to use which one, i am confuse about the situation where i can use them. So How these term are different?

Original source