If we can just store information in variables why do we need a sessional cookie or sessional storage?
You most likely would only store a session ID in a cookie. This will be used to look up the session data in the database. The session data will probably have additional information such as creation date, last request date, username, expiration data, and maybe a status (keep alive etc) and any other ID's...
Because variables are only good for the page that's being generated. If the user clicks through to the next page then you will have lost that information.