123 Eng

Engineering the engineers™


Latest Jobs   Forum Map

 


Home

Source Codes

Engineering Colleges

BE Students

Training  Reports (updated)

Seminar Reports (updated

Placement Papers (updated)

Forums

   Computer Science / IT

   Electronics

   Electrical

   Mechanical

   Chemical

   Civil

   CAT / MBA

   GMAT / Foreign MBA

Latest Jobs

Engineering Jobs / Technical Jobs

Management Jobs

Sitemap

About-Us

Terms of use

Displaying  Source Code(s)  
 

 
Reading and writing cookies

--------------------------------------------------------------------------------

Description : You cannot do much useful in the Internet world without writing a cookie to the users browser. This code shows you how to store a cookie and cookie value and then retrieve it using the response and request object.

<%@ LANGUAGE="VBSCRIPT" %>
<%option Explicit
Response.Buffer = True
Dim strCookieName
Dim strCookieValue
' Get the values passed in by the other
' script
strCookieName = "MyOwnCookie"
strCookieValue = "23"
' set the domain of the cookie to your o
' wn domain
' so it doesn't get confused with
' cookies created for Microsoft.com for
' example.
Response.Cookies(strCookieName).Domain = ".MyDomain.com"
'set cookie value
Response.Cookies(strCookieName) = strCookieValue
'set cookie expiration date
'note:set this to yesterday (or earlier)
' and you can
'delete the cookie!
Response.Cookies(strCookieName).Expires = Date() + 1
%>
The cookie <%= strCookieName%> Is =
<%= Request.Cookies(strCookieName)
%>
 

 

Contribute content or training reports / feedback / Comments
job placement papers
All rights reserved copyright 123ENG