We can send some cookies to visitor’s browser by setcookie(). When defining a value with $_SESSION['value'], if using session.use_only_cookies, the session will be only stored on the visitor’s browsers. What is the difference of these two cases?
EDIT: Obviously, they are basically different. I just meant the difference in their application. We can set a value on the client-side, which can be retrieved any time (before expiration of course) with $_COOKIE or $_SESSION equally; e.g. to identify a returning visitor.
A cookie is stored on the client-side(i.e. “within” the client/browser).
_SESSION is serialized and then stored on the server. This data is associated with a session id. E.g. when using the default filesystem session handler the filename reflects the session id. The client (or your script) has to provide that session id in subsequent requests so that php’s session management can/will load the session data again. One mechanis for this is to use cookies.
session.use_only_cookies=Onlets php’s session mechanism look only for session ids in cookies.