Flag This Hub

Programming.a.baby - (Asp) Object Request Cookies

By


Asp Article 10

Why Cookies

In this Article i will show you how to request a Cookie, using Asp

The questions are:

  1. What is a Cookie?
  2. Why we need Cookies?
  3. What i would do with it?
  4. How to set a Cookie?
  5. How to Request it?

Stay with me and lets learn how and why!

Hey You There

- AH! Before we continue, I know that I've many visitors reading my Asp Articles, i can see that in the statistics, so i want you to know that all these Articles and Code are all my work, is not some copy and paste stuff, and you know that this takes time.

You learn in the easiest way and you do not pay for this, so even if you are a beginner, a curious person or a programmer with some practice, the only thing i ask you is:

Please Comment, i will appreciate your comments and i will answer them, I've more than 20 year of programming practice, and i work with almost 30 languages, but i share it with you, no secrets.


...

 

What is a Cookie

A cookie is a file that the Web server will install in the USer's Web Browser, which can serve you for reconize the user and to write values on it.

 

Why i need Cookies

Almost every Web Site use Cookies.

They do it because they want to set parameters that will help them to know if the user is still there and what kind of preferences he has...etc

 

What i would do with it

You will discoverer how good this will be for your own info, after you start using it

Code 1 - Create Cookie

<%

 Response.Cookies("nickname")="Fantasy"

%>
 

Request Cookie

To Request the Cookie you just create, you do like tou see in the Code 2 - Request Cookie.

Then you can manipulate it by for example writing it in the Web Page, so the user will see it, or you can invent many other utilizations.

Code 2 - Request Cookie

<%

 Cnick = Request.Cookie("nickname")

 Response.Write ("Your Nickname is" & Cnick)

%>
 

Setting a Cookie

For setting a Cookie in the user's Web Browser the procedure is very simple, like you can see in the Code 1 - Create Cookie.

This will create the cookie that you can manipulate during the time that user will maintain the Web Browser open.

.

Next -->

Programming.a.baby - (Asp) Functions


Comments

No comments yet.

Submit a Comment
Members and Guests

Sign in or sign up and post using a hubpages account.



    Like this Hub?
    Please wait working