Figure 5.32. The cookie has persisted
If you reload the page, the cookie will be found, and youll get a different message,
as Figure 5.32 shows.
If you go through the code, youll see that its pretty much self-explanatory.
Whats interesting to observe is that you can close the browser window, or even
restart your computerthe cookie will still be there, and the application will be
able to identify that youre a returning visitor. As you can see in the code, the
cookie is set to expire one month after creation.
Be aware that visitors can choose to reject your cookies, so you cant rely on them
for essential features of your application.
Starting the Dorknozzle Project
Youre now prepared to start developing a larger project! We were introduced to
Dorknozzle at the beginning of the chapter, and youve already created a project
for it. Now, its time to add some real functionality to it! In the next few pages,
we will:
Prepare the sitemap for your site.
Create a default theme that defines the common styles.
Create a master page that will contain the layout for all the pages of
Dorknozzle.
Create a web form that uses the master page.
Learn how to debug your project in case you encounter errors.
186
Chapter 5: Building Web Applications

Get Build Your Own ASP.NET 2.0 Web Site Using C# & VB, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.