adsense


Showing posts with label VB SCRIPT COOKIES EXPIRATION DATE. Show all posts
Showing posts with label VB SCRIPT COOKIES EXPIRATION DATE. Show all posts

Saturday, 7 November 2015

VB SCRIPT COOKIES EXPIRATION DATE PAGE 28

COMPUTER LANGUAGES HTML,C,C++.JAVA,.NET AND MULTIMEDIA basics and programs click home button




VB SCRIPT COOKIES EXPIRATION DATE




Cookies Expiration Date 

You can extend the life of a cookie beyond the current browser 
session by setting an expiration date and saving the expiration 
date within the cookie. This can be done by setting the expires 
attribute to a date and time. 
Example 
The following example illustrates how to set cookie expiration 
date after 1 Month: 
<html> 
<head> 
<script type="text/vbscript"> 
Function WriteCookie() 
   x = now() 
   y = dateadd("m",1,now())  ' Making it to expire next  
   cookievalue = document.myform.customer.value 
   document.cookie = "name = "  & cookievalue 
   document.cookie = "expires = " & y 
   msgbox("Setting Cookies : " & "name=" & cookievalue ) 
End Function 
</script> 
</head> 
<body> 
<form name="myform" action=""> 
Enter name: <input type="text" name="customer"/> 
<input type="button" value="Set Cookie" onclick="WriteCookie()"/> 
</form> 
</body> 
</html>