michaelsanford
Translator, Web Developer
I've got a bunch of PHP scripts that need to access a variable $username.
If I register $username as a session variable, I can use it throughout the site. The only thing is, I'd also like to save it to a cookie.
Can I safely save the session variable $username to a cookie also called username, or will that defeat the ideas of sessions.
For that matter, why should I bother using sessions at all, and not just use cookies everywhere since there's no difference in the way the variables are accessed (with the obvious exception of session_start() and session_register beginning the script...)
Thanks for any insight!
If I register $username as a session variable, I can use it throughout the site. The only thing is, I'd also like to save it to a cookie.
Can I safely save the session variable $username to a cookie also called username, or will that defeat the ideas of sessions.
For that matter, why should I bother using sessions at all, and not just use cookies everywhere since there's no difference in the way the variables are accessed (with the obvious exception of session_start() and session_register beginning the script...)
Thanks for any insight!