Posts

Showing posts from February, 2015

Read and write cookies

Cookies are usefull in the world of web programming. You can save values on a site and read them on an other one. You can use cookies in JavaScript and it is pretty easy. All you need are two functions. The first one is called "set_cookie" and creates them. In the call of the function you need give your cookie a name (make sure it is an unique name, or you overwrite some existing cookies). Then you need the value of the cookie. At least you give the cookie a 'lifetime'. An expiredate is important because there is no garbage collector for cookies.