adsense


Showing posts with label VB SCRIPT DELETING A COOKIE. Show all posts
Showing posts with label VB SCRIPT DELETING A COOKIE. Show all posts

Saturday, 7 November 2015

VB SCRIPT DELETING A COOKIE PAGE 29

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




VB SCRIPT DELETING A COOKIE




Deleting a Cookie 


Sometimes, you will want to delete a cookie so that 
subsequent attempts to read the cookie return nothing. 
To do this, you just need to set the expiration date 
to a time in the past. 
Example 
The following example illustrates how to delete a cookie 
by setting its expiration date 1 Month in the past: 



<html> 
                
<head> 
<script type="text/vbscript"> 
Function WriteCookie() 
   x = now() 
   x = now() 
   a = Month(x)-1 
   b = day(x) 
   c = year(x) 
   d = DateSerial(c,a,b) 
   e = hour(x)  
   msgbox e 
   f = minute(x) 
   msgbox f 
   d = cdate(d & " " & e & ":" & f) 
   msgbox d 
   cookievalue = document.myform.customer.value 
   document.cookie = "name = "  & cookievalue 
   document.cookie = "expires = " & d 
   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> 
Number functions help the developers to handle numbers in an 
efficient way and also helps them to convert their subtypes. 
It also helps them to make use of the inbuilt mathematical 
functions associated with VBScript.