• home
  • forum
  • my
  • kt
  • download
  • Cookies

    Author: 2007-06-25 11:02:39 From:

    A cookie is a small file that the server stores on the user's computer. Cookies are very useful and you can use them to store password, user last visit, etc.

    How to create a cookie

    Response.Cookies("YourWebSite")("UserName") = "Marc"
    Response.Cookies("YourWebSite")("UserMail") = "marc@domain.com"
    Response.Cookies("YourWebSite").Expires = Now() + 365

    This will store the user's name and e-mail in the cookie "YourWebSite" on the computer.

    Cookie will expire after 365 days from the time the cookie was put on the computer.

    How to retrieve a cookie value

    In this example we will store cookie value in variable.

    Dim UserName
    Dim UserMail

    UserName = Request.Cookies("UserName")
    UserMail = Request.Cookies("UserMail")

    Response.write "Your name is:" & UserName & " and your mail is: " & UserMail

    discuss this topic to forum

    relation tutorial

    No relevant information

    New

    Hot