Forum Moderators: DixonJones

Message Too Old, No Replies

Cookies vs. Sessions?

the difference between the two?

         

lebhead

4:05 pm on Jun 11, 2003 (gmt 0)

10+ Year Member



Hi, I wasn't sure if I should post this question here or in the ASP/MS forum (since I will be using ASP pages), so feel free to move it if you feel it is in the wrong place.

I have a question regarding cookies vs. sessions (which from what I understand use a form of cookies as well). I'm creating a form that checks for various things and I need to keep track of whether or not User X has filled out the form already. There is no database query option (ie. check to see if User X's e-mail address already exists in the DB), so I'm left with using cookies of some sort to tell whether or not User X has been there before.

My question is what is the difference between using a cookie (say, for maybe 1 week) versus using a session (which from what I understand uses a shorter cookie)? Is there a large difference in users who will accept one and not the other?

I appreciate any help. Thank you.

-Andrew

DaveN

4:14 pm on Jun 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



a session only lasts as long as the browser is open, Drop a cookie it's easier.

dave

Iguana

2:15 pm on Jun 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The user may however have elected not to accept cookies (rare).

A session variable will only store data for that instance of the browser window - if they come back to the page in another window then the other session data will not be available.