Forum Moderators: coopster
I'm getting very confused. Please help. My use of cookie varaibles and _SESSION variables is leading to parallel sets of governing variables.
Cookies: Using setcookie(): I'm trying to use the cookie to store user related variables which govern the access, language, location, etc.
_SESSION[-variables-]: using session_start() at the beginning of a session enables _SESSION variables to be stored - which govern the access, language, location, etc.
It seems easier and more permanent to store _SESSSION variables than store them in a cookie?! If I stored them only in _SESSION-variables I would not run the risk of cookie-variables and session-variables conflicting.
So confused.
Please help clarify the differences.
Thanks - look forward to your replies
GrahamB
if you are using sessions then drop the explicit use of cookies. a cookie will be set with their session id but that takes care of itself. store everything in the session and then if somehow there is some confusion or conflict, make them re login.
as far as differences
a cookie is a chunk of info on the client side
a session is a file stored on the server, a cookie is usually set to reference the id or name of that file
sessions are much easier to work with imo