Search all files of the entire web site for the exact phrase "request.cookies"
and delete them (also uses the kill statement).
<%
' declare variables
dim a, b, i
' search the entire web site for the phrase "request.cookies"
a = Search( "request.cookies", server.mappath("/") )
' iterate the array of results
b = split(a , vbCrLf)
For i = 0 to ubound(b) - 1
' delete each matching page
Kill b(i)
Next
%>
<%
Private Function Search(byVal phrase, byVal directory)
Dim objFSO, currentFolder, objFile, currentFile
Dim strSearch, fileContents, objFolder
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set currentFolder = objFSO.GetFolder(directory)
For Each objFile In currentFolder.Files
If LCase( objFile.Path ) = _
LCase( server.mappath( _
request.serverVariables("SCRIPT_NAME") ) ) Then
Else
Set currentFile = _
objFSO.OpenTextFile( objFile.Path, 1, False )
fileContents = lcase( currentFile.ReadAll() )
currentFile.Close
Set currentFile = Nothing
If Instr( fileContents, phrase ) Then
strSearch = strSearch & objFile.Path & vbCrLf
Else
strSearch = strSearch & ""
End If
End If
Next
For Each objFolder in currentFolder.SubFolders
strSearch = strSearch & Search( phrase, objFolder )
Next
Set currentFolder = Nothing
Set objFSO = Nothing
Search = CStr( strSearch )
End Function
%>