It shows that you are unregistered. Please register with us by clicking Here
![]() |
|
![]() |
![]() | Register - FAQ - Today's Posts - New Posts - Support - Search | ![]() |
|
|
#1 (permalink) |
|
Junior Member
Join Date: Jul 2006
Age: 47
Posts: 25
|
Cookies are little pieces of data stored on the client. With each Web request the cookies are sent back to the server and accessible from ASP.NET code, which allows you to perform tasks such as site personalization.(IIS actually use cookies to help manage sessions.) For example, the following lines of code send a Zipcode cookie back to the user:
Dim ckZip As new HttpCookie("Zipcode") ckZip.Value = "28138" ckZip.Expires = DateTime.Now.AddDays(30) Response.Cookies.Add(ckZip) When the user access the site again, the Zipcode cookie will be sent to the server, allowing it to display the weather or other ZIP Code-related information automatically. The Expires property of the cookie instructs the browser to throw it away after 30 days. If you are curious how and where cookies are stored, look in the Temporary Internet Files folder. To view these files from Internet Explorer, choose Internet Option from the tool menu and click View Files. Drag one of the cookie files (begins with the word cookie) to the desktop and then open it in a text editor. Because cookies are stored as plain text, I would recommend the following precautions when using cookies to keep track of a user's identity. Use a random number (that is a GUID)rather then any actual key value from the database. If your Web site has a list of users, do not display their random number in URL's. Without taking the previous precautions, a user could edit his cookie file and impersonate another user. |
|
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| HOW TO: Send email using System.Net.Mail | shawn | .NET | 4 | 05-15-2008 08:20 PM |
| Does Google Send Checks Anywhere? | GuyKels | 10 | 06-20-2007 06:47 PM | |
| Tracking Cookies, with MySQL and CGI.pm | Ankita | Perl | 0 | 08-19-2006 09:43 AM |
| I have a client on a budget ... | rowedf | Marketing | 2 | 07-23-2006 02:36 PM |