|
Free printable Sudoku Puzzles | Custom Word Search Puzzles | iptocountry.info | Free web storage |
| Active Server Pages: Cookies |
When the visitor gets to our asp file we may save information related with him in his computer. The order will be like this one:
<% response.Cookies ("whatever")="information" %>
When this line is executed, the visitor will have the information in his computer, and whenever we need that information, we may request it using this code:
<% =request.Cookies ("whatever") %>
or
<% variable1=request.Cookies ("whatever") %>
Let's try an example using Cookies method: let's consider we have visitors
checking our site several times and we want to let them know how many times
they have accessed to our computer.
| cookiesexample.asp try ! |
| <% If Request.Cookies ("NumberVisits")="" Then %>
<% Response.Cookies ("NumberVisits")=1 %> This is your first visit to this page. Welcome. <% Else %> <% VarNumberVisits=Request.Cookies ("NumberVisits") VarNumberVisits=VarNumberVisits+1 Response.Cookies("NumberVisits")=VarNumberVisits %> Welcome back to this page. You
have visited this page <% =VarNumberVisits %> times.
<% End If %> |
Cookies method may be used to show visitors specific information we have requested throw a form, as for example a list of links related to a specific theme, information to allow access to the content of a page or to personalize the page (background color, frames or not frames...), information to fill a form automatically, etc.
|
|
Create word search puzzles with your own words
|
Tutorial home page
2008@ AspTutorial.info. All rights reserved.