Amazon.com: PC Books || Educational Software || Magazines
Amazon: Books-CA || Software-CA || Books-UK || Software-UK

HTML | Javascript | ASP | PHP | VBScript | SQL | Hardware | PC FAQ| WinXP|

Learn to Build, Upgrade, or Repair your Computer Ebook + PC Safety 101 kwwebservice.com Reasonably priced web development & hosting
ASP Basics
Introduction
Variables & Arrays
Sub & Functions
If Statements
Case Statements
Loop Statements
Date Objects
Form Processing
Text File Objects
Database Access
Adding Record
Updating Record
Deleting Record
Virtual Includes
Cookies
Server Variables
Creating Login Page
E-mail
ASP Books @
CA Amazon
UK Amazon
US Amazon

  :: Home
PC Topics
  :: Build A PC
  :: Windows XP
  :: PC Help
Tutorials
  :: HTML
  :: JavaScript
  :: ASP
  :: PHP
  :: VBScript
  :: SQL
Miscellaneous
  :: Code/Scripts
  :: Forum
  :: Links
  :: Contact us
  :: Tell A Friend
  :: In Somali
  ::
Web Articles
  Top Web Hosting
Reviews
  Processing
Online Card Payment Guide
  Domain name
registration & buying guide
  Getting
a website online guide
  Search Engine
submission & optimization tips
Netfirms Web Hosting
Free trial
Quality business correspondence.
Yahoo! Search Marketing

ASP Cookies

A cookie is object used to identify the user by his/her computer.  Each time the same computer access the page, the cookie will also be retrieved if the expiry date has future value.   Creating cookies in asp is very simple.  Use Response.Cookie to create a cookie or Request.Cookie to read a cookie.
The following example creates a cookie named userName and assigns value:
<%
  Response.Cookies("userName")="user123"
%>

The example bellow will retrieve the cookie we create above:
<%
  user=Request.Cookies("userName")
  response.write("Welcome " & user)
%>
The result of the above example will look like this:
welcome user123

The cookie will be deleted after your browser is closed unless you set the expiry date to a future date.
The following example will keep the cookie in place for 30 days after setup date:

<%
  Response.Cookies("userName")="user123"
  Response.Expires("userName").Expires = Date + 30
%>

You can also set a cookie with multiple values like the following:

<%
Response.Cookies("user")("userName") = "Bell"
Response.Cookies("user")("firstName") = "Bellion"
Response.Cookies("user")("lastName") = "Briabion"
%>

The above Cookie has Keys.  When you want retrieve a cookie with multiple values, you will have to loop through the values using for loop statement

Virtual Includes Server Variables
Bluehost.com Web Hosting $6.95
PC System Tools
SpyCleaner
Registry Mechanic
4Diskclean Pro
Health PC Club
TweakNow
Registry Washer
SpyAnyWhere
System Lifeguard
...More/Details

PC Articles
  Computer Safety
prevent viruses & Spyware