ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I understand that a website can set a cookie which means a little text file with a no. in it will be created on the client side, and then the no. will get sent to the server with every visit. But how is this used to customize a page? Does this mean that a MySQL database *has* to be created, which can be used to match up that no. with a particular login name, for instance? How exactly is this pulled off?
I understand that a website can set a cookie which means a little text file with a no. in it will be created on the client side, and then the no. will get sent to the server with every visit. But how is this used to customize a page? Does this mean that a MySQL database *has* to be created, which can be used to match up that no. with a particular login name, for instance? How exactly is this pulled off?
Thanks.
Number ? If yes, why only number ? Is it documented that only number can be present in a cookie ?
A cookie can contain any information, it is just a mechanism of transferring data between the browser and the server. Each cookie has a life.Some may just live for the duration of that session, close the page and the cookie will be deleted. Others may last longer so that the next time that you visit the page the cookie is sent.
A cookie that lasts the duration of your visit is often used to identify you with the server. In this example an ID is sent to the server and this can be used to get session information (In PHP terms the session data is managed automatically so you don't need to worry about what is actually sent, and the session data is stored on the server, this is useful because it adds an element of security and reduces the amount of data being sent)
A persistent cookie, one that lasts between sessions, can record details of the users preferences, what page they were viewing last and so on.
The actual data that is in a cookie is only restricted by your imagination; what I suspect you are getting confused with is the cookies used for session management.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.