Jump to content


Photo

Cookies or sessions?


  • This topic is locked This topic is locked
24 replies to this topic

Poll: Which do you prefer? (59 member(s) have cast votes)

Which do you prefer?

  1. Cookies (6 votes [10.17%])

    Percentage of vote: 10.17%

  2. Sessions (53 votes [89.83%])

    Percentage of vote: 89.83%

Vote

#1 Kurt

Kurt
  • Members
  • PipPipPip
  • Advanced Member
  • 42 posts
  • LocationNew York

Posted 08 July 2006 - 08:51 PM

Do you prefer to use cookies or sessions when storing data for things such as login systems? I prefer cookies because they are just easier to use. Some people say they don't like them because if you store sensitive information in them, people can edit it and etc. To get around this, I just store encrypted information in them. So discuss what you think is better and why.

#2 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 09 July 2006 - 09:59 AM

They both have their uses, as well as their pros and cons. But I personally prefer to use sessions when I have the choice.

#3 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 09 July 2006 - 03:41 PM

I would have voted both if I could, because it depends on the situation. I use cookies for storing things for long time and sessions for stuff that do not have to be saved when the user has gone away.

#4 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 10 July 2006 - 12:42 PM

Both, but I chose sessions.

Info: PHP Manual


#5 pixy

pixy
  • Members
  • PipPipPip
  • Advanced Member
  • 295 posts

Posted 15 July 2006 - 03:57 AM

Sessions, they're more secure.

This is a .44 Caliber Loveletter straight through my heart.

Tabulas + Threadless + Hire Me!


#6 hvle

hvle
  • Members
  • PipPipPip
  • Advanced Member
  • 667 posts
  • Locationmelbourne, Australia

Posted 15 July 2006 - 02:22 PM

How can you compare SESSION and cookie.  It's like comparing PHP and java script.  It's totally different thing.
Life's too short for arguing.

#7 pixy

pixy
  • Members
  • PipPipPip
  • Advanced Member
  • 295 posts

Posted 17 July 2006 - 03:48 PM

^ Not really. You can choose to store information as a session, or as a cookie. Its a preference.

This is a .44 Caliber Loveletter straight through my heart.

Tabulas + Threadless + Hire Me!


#8 hvle

hvle
  • Members
  • PipPipPip
  • Advanced Member
  • 667 posts
  • Locationmelbourne, Australia

Posted 18 July 2006 - 12:51 AM

I know, both can store information.
But other issue involved.  cookie is client's side while session is server side.
user had total control of cookie, and no control over session.

my point is, as a web developer, who would want to store data in a such a way that user/client can modify it however he wanted.
Life's too short for arguing.

#9 KefkaIIV

KefkaIIV
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 19 July 2006 - 04:23 PM

Sessions, but I don't see a huge difference.

Click the below banner to earn money for participating in surveys!


#10 dark dude

dark dude
  • Members
  • PipPipPip
  • Advanced Member
  • 53 posts

Posted 22 July 2006 - 10:34 AM

Sessions, most users' browsers are set to block cookies anyway

#11 mithu_sree

mithu_sree
  • Members
  • PipPipPip
  • Advanced Member
  • 34 posts
  • LocationIndia

Posted 13 December 2006 - 04:58 AM

i like both
--
Mithun Sreedharan

Let All the Beings in All the World be Happy !!
"Lokah Samasthah Sukhino Bhavanthu"

#12 fert

fert
  • Members
  • PipPipPip
  • Advanced Member
  • 1,114 posts

Posted 13 December 2006 - 05:18 AM

I use sessions

Si hoc legere scis nimium eruditionis habes
Gentoo Linux 2007.0 Firefox 2

#13 neylitalo

neylitalo
  • Staff Alumni
  • Advanced Member
  • 1,854 posts
  • LocationMichigan, USA

Posted 13 December 2006 - 06:42 AM

Sessions, most users' browsers are set to block cookies anyway


I would say quite the opposite. The great majority of websites require cookies, so users are more likely to enable cookies. All the statistics I've seen seem to indicate that users with cookies disabled are few and far between.
http://nealylitalo.net - My personal website, and home of The Netizen's Journal.

#14 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 18 December 2006 - 09:06 PM

I choose both.  I try to incorporate using both in my site, but I take the ajax/js approach: Use it for added features/functionality, but script it to gracefully fall back without it.

you should have added a "both" option on your poll.
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#15 lszanto

lszanto
  • Members
  • PipPipPip
  • Advanced Member
  • 110 posts
  • LocationDown Under, Australia

Posted 01 January 2007 - 08:28 AM

I prefer to use sessions but am happy to use both.

#16 phrozenflame

phrozenflame
  • Members
  • PipPipPip
  • Advanced Member
  • 106 posts
  • LocationWoking,Surrey UK

Posted 01 January 2007 - 09:22 AM

Sessions
A flame wich is phrozen

#17 448191

448191
  • Staff Alumni
  • Advanced Member
  • 3,545 posts
  • LocationNetherlands

Posted 01 January 2007 - 09:14 PM

How can you compare SESSION and cookie.  It's like comparing PHP and java script.  It's totally different thing.


Nobody said anything about $_SESSION or session_*  ;)

You can't compare sessions and cookies. "Sessions" is a concept, cookies are something concrete.

I do prefer using a proper session management system instead of some randomly acessible cookies however.    ;)

#18 AXiSS

AXiSS
  • Members
  • PipPipPip
  • Advanced Member
  • 234 posts
  • LocationComputer

Posted 02 January 2007 - 02:22 PM

I prefer sessions but to me it seems like what you use depends on what you are using it for.
Join Gamegum!

$Programmer != $Graphic_Designer;
$Graphic_Designer != $Programmer;
$AXiSS == $Graphic_Designer;

#19 ted_chou12

ted_chou12
  • Members
  • PipPipPip
  • Advanced Member
  • 1,488 posts
  • Location@ Mars

Posted 03 February 2007 - 11:27 AM

I prefer sessions, because I cant get cookies to work properly,
btw

you should have added a "both" option on your poll.

if both option is available, then whats the point of this poll?
Ted
Currently working on a website called NetFriending.co.cc, it is a free social networking site, features such as guestbook, blogs, are fully customizable in NetFriending, also has a forum to help you get to know others, if you are interested in the site, the url is: NetFriending.co.cc Hope everyone can get involved because the site is still quite new, so not much people are there at the moment, please feel free to leave a comment there or send a message to our staff. Register Here The link above is for registeration, it is 100% Free and Safe, everyone there is friendly and you can build your network. Photo sharing upload your own photos as well!!!

#20 neylitalo

neylitalo
  • Staff Alumni
  • Advanced Member
  • 1,854 posts
  • LocationMichigan, USA

Posted 03 February 2007 - 09:06 PM

I think the point CV was trying to make was that they are not mutually exclusive. Cookies work better for some things, sessions for others.
http://nealylitalo.net - My personal website, and home of The Netizen's Journal.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users