Jump to content

Archived

This topic is now archived and is closed to further replies.

Kurt

Cookies or sessions?

Which do you prefer?  

59 members have voted

  1. 1. Which do you prefer?

    • Cookies
      6
    • Sessions
      53


Recommended Posts

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.

Share this post


Link to post
Share on other sites
They both have their uses, as well as their pros and cons. But I personally prefer to use sessions when I have the choice.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Both, but I chose sessions.

Share this post


Link to post
Share on other sites
How can you compare SESSION and cookie.  It's like comparing PHP and java script.  It's totally different thing.

Share this post


Link to post
Share on other sites
^ Not really. You can choose to store information as a session, or as a cookie. Its a preference.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[quote author=dark dude link=topic=99899.msg401603#msg401603 date=1153564499]
Sessions, most users' browsers are set to block cookies anyway
[/quote]

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
I prefer to use sessions but am happy to use both.

Share this post


Link to post
Share on other sites
[quote=hvle]How can you compare SESSION and cookie.  It's like comparing PHP and java script.  It's totally different thing.[/quote]

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.    ;)

Share this post


Link to post
Share on other sites
I prefer sessions but to me it seems like what you use depends on what you are using it for.

Share this post


Link to post
Share on other sites
I prefer sessions, because I cant get cookies to work properly,
btw
[quote author=Crayon Violent link=topic=99899.msg487648#msg487648 date=1166475987]
you should have added a "both" option on your poll.
[/quote]
if both option is available, then whats the point of this poll?
Ted

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[quote author=ted_chou12 link=topic=99899.msg520982#msg520982 date=1170566757]
okay, neylitalo, you got a point there, i like the word you chose as well.
Ted
[/quote]

Which word was that?

Share this post


Link to post
Share on other sites
Sessions are usefull if you need to just store some data that you're going to use later, coockies would be better if you are going to store something for a while. For the coding I'm currently doing, I use sessions.

Share this post


Link to post
Share on other sites
okay seriously, I think it has been long established that this isn't really a proper poll, since you wouldn't normally *choose* sessions over cookies. 

thread closed.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.