I am developing a site where peoples can register for account, but i get confused weather to use session or cookie,,,, and also i like to know, with using session i can implement "remember me" option,,, ?? what are the adv. & disadv. of session & cookies,,, give advice what to use weather session or cookies or both,,,
the different betwen session and cookies is session store the information on you server , cookies store the information on the user computer. to make a registration i like to use session because some user have set the browser to don't accept cookies.
A lot of times sessions will use cookies to keep track of the session id anyways. When a session can't use cookies, it will end up passing the SID along with GET variables on the URL.
Session variables have a very short life span; they last until the end of the visit. When the user closes their browser, all the info stored by session variables is lost, so you can't have a remember me option that uses session. Also session variables tend to expire even before the end of the visit, so if you have a log in system that uses them, users will occasionally be logged out while browsing through your site. Implement both and use cookies as the default choice. If they are disabled on the user's computer, switch to session instead.
use both... basically set the login system to work on session but also create cookies system so that if sessions arent there but cookies are then users can login directly