Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Disable cookies in IE8?
#2
Solved: 11 Years, 4 Months ago
The most reliable way I know would be to edit the registry settings. Here's some subroutines that will disable/enable cookies (you have to call the sub, then open the browser, or restart the browser after calling it). Instead of just calling the enable sub, you might want to read the registry setting before altering it (ShellObj.RegRead) so that you can set it back where it was. Setting it to 0 will allow ALL cookies. Refer to this for more info on the registry settings for IE and what they mean: http://support.microsoft.com/kb/182569

Code:
'@Description Disables cookies in Internet Explorer for the current user. Browser(s) must be restarted for this to take effect!
Public Sub DisableCookies()
    Set ShellObj = CreateObject("WScript.Shell")
    ShellObj.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3\1A10", 3, "REG_DWORD"
    Set ShellObj = Nothing
End Sub

'@Description Enables cookies in Internet Explorer for the current user. Browser(s) must be restarted for this to take effect!
Public Sub EnableCokies()
    Set ShellObj = CreateObject("WScript.Shell")
    ShellObj.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3\1A10", 0, "REG_DWORD"
    Set ShellObj = Nothing
End Sub
Reply


Messages In This Thread
Disable cookies in IE8? - by ngocvo3103 - 01-18-2011, 03:20 PM
RE: Disable cookies in IE8? - by cdesserich - 01-20-2011, 10:44 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Delete Firefox history and Cookies Anupama 0 1,435 06-18-2018, 11:57 AM
Last Post: Anupama
  How to check expected cookies are present or not priyanka.agarwal 0 1,973 07-02-2015, 12:43 PM
Last Post: priyanka.agarwal
  QTP 10 not identifying objects in IE8 on 64 bit OS Ram2009 6 4,695 03-24-2015, 05:46 PM
Last Post: vinod123
  Disable data window? Autobot 0 1,708 11-26-2014, 10:16 AM
Last Post: Autobot
  How to delete the cookies (1000 records) akhandesh 1 2,741 09-03-2014, 09:57 AM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 1 Guest(s)