This is what I used to write last year with ASP, a shopping cart subject, has been tested, running well, hoping to give the benefits of ASP enthusiasts

Source: Internet
Author: User
Tags setcookie
<%@ Language=vbscript%>
<%Response.Expires=0%>
<%
' Write Cookie
' Response.Write request.cookies ("Warebuycount")
Sub Setcookie (Aname,warenum,warename,price,warecount,pricelow)
Response.Cookies (Aname). Domain=application ("Wareurl") ' Wareurl represent domain name
Response.Cookies (Aname). Expires=date () +30 ' cookie expiration date
Response.Cookies (aname). Path= "/"
Response.Cookies (Aname). Secure = FALSE
Response.Cookies (Aname) ("Warenum") =warenum ' commodity number
Response.Cookies (Aname) ("Warename") =warename ' product name
Response.Cookies (Aname) ("Price") =price ' prices
Response.Cookies (Aname) ("Warecount") =warecount ' quantity purchased
Response.Cookies (Aname) ("Pricelow") =pricelow ' member Price
End Sub
Sub SetCount (Warebuycount) ' is used to calculate the types of goods purchased by customers
Response.Cookies ("Warebuycount"). Domain=application ("Wareurl")
Response.Cookies ("Warebuycount"). Expires=date () +30
Response.Cookies ("Warebuycount"). Path= "/"
Response.Cookies ("Warebuycount"). Secure=false
Response.Cookies ("Warebuycount") =warebuycount
End Sub
' Write cookies
Sub Setcookies (Warenum,warename,price,warecount,pricelow,warebuycount)
Setcookie "Warenum" +cstr (warebuycount), Warenum,warename,price,warecount,pricelow
End Sub
Sub Delcookies (Delwarenum)
Warebuycount=request ("Warebuycount")-1
While Cint (Delwarenum) <=cint (Warebuycount)
Setcookies request.cookies ("Warenum" +cstr (delwarenum+1)) ("Warenum"), Request.Cookies ("Warenum" +Cstr (delwarenum+1 ) ("Warename"), Request.Cookies ("Warenum" +cstr (delwarenum+1)) ("Price"), Request.Cookies ("Warenum" +cstr ( delwarenum+1)) ("Warecount"), Request.Cookies ("Warenum" +cstr (delwarenum+1)) ("Pricelow"), Delwarenum
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.