i now the differece between seesion and cookies. but i am not sure when one to use. when people make website like dreamincode, myspace, linkedin, etc.. wht they use.

right now on my site when user log in session get started but if user hit remember me than cookie get start. this is a good idea or bad idea? let me know


Recommended Answers

All 2 Replies

So essentially, a cookie is stored on the person's machine, whereas a SESSION is stored onto the server.

Ok, it depends on the situation in which you are using and both of them will work in most situations, so for me, it's down to the fact I prefer SESSIONS over COOKIES.

I'll answer this question (in my opinion):

but if user hit remember me than cookie get start. this is a good idea or bad idea?

It's a good idea and a bad idea. If you're storing really secure information about the user and the user signs into a machine that many people use then offering this service would be a disadvantage (from the user's prospective).

Sorry if this isn't much help.

Member Avatar for diafol

Remember that you need to allow cookies to enable sessions to work. Needs to store the UID.

Sessions will be easier than cookies. Also, you don't need to save various bits of data to the client - all on the server. The session timeout is taken care of for you - or you can set it. The cookies need an expiry time, which can be a pain. Cookies have become a bit of an issue within the EU of late.

Cookies for 'remember me' - can't see any other way of doing that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.