ASP Cookies - Sample ASP Files - Cookies Motes Notes...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Sample ASP Files - Cookies Mote’s Notes 4/27/2011 Cookies can be used to pass information between multiple ASP scripts. Cookies allow a much more flexible application design than the classic drill-down, page-to-page parameter passing we've seen in our other sample ASP scripts. The general command for saving a value (i.e., parameter) in a cookie is: Response.Cookies("CookieName")("ParameterName") = Value You can save any number of values in a single cookie. The general command for reading a previously saved value is: Value = Request.Cookies("CookieName")("ParameterName") This small example demonstrates the basic mechanics of using cookies. The CookieWriter.asp script writes the user's information (and an expiration date/time) to a cookie named SampleCookie on the user's computer. The CookieReader.asp script reads the information from the previously created cookie. CookieWriter.asp
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 <% ' The Response.Buffer command should be the first line of any file that writes cookies Response.Buffer=True %> <html>
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/26/2011 for the course MIS 325 taught by Professor Mote during the Spring '08 term at University of Texas at Austin.

Page1 / 4

ASP Cookies - Sample ASP Files - Cookies Motes Notes...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online