by Davdub November 28th 2014, 1:39 pm
Lesson 13: Cookies
How and what kind of information websites are collecting from their users, and especially how they use it, is a hot topic. Often cookies are mentioned as an example of how information is collected and pose a threat to your privacy. But are there reasons to be worried? Judge for yourself. Once you have gone through this lesson, you will know what can be done with cookies.
What is a cookie?
A cookie is a small text file in which a website can store different information. Cookies are saved on the user's hard drive and not on the server.
Most cookies expire (delete themselves) after a predetermined time period, which can range from one minute to several years. But the user can also identify and delete any cookies on his/her computer.
Most browsers - such as Microsoft Internet Explorer, Mozilla Firefox and Google Chrome - can be configured to let the user choose whether or not he/she will accept a cookie. But then, why not just say no to all cookies? It is possible. But many websites would not work as intended without cookies, since cookies in many contexts are used to improve the usability and functionality of the website.
How is information stored in a cookie?
It easy to set or modify a cookie in ASP with DocumentationResponse.Cookies . In the first example, we will create a cookie and set the value.
First, you need a name for the cookie. In this example we will use the name "HTMLTest". Next, you set the value of the cookie like this:
<%
' Setting the cookie
Response.Cookies("HTMLTest")("Name") = "C. Wing"
Response.Cookies("HTMLTest")("interest") = "planespotting"
' How long the cookie should last - in this case one year
Response.Cookies("HTMLTest").Expires = Date+365
%>
All these information was copy from the website wasn't forum Admin..