flann
Regular Member
- Jan 19, 2008
- 208
- 34
I have a application created in VB. Now i need the app to have its own cookies folder. I have done that, but it is not working as it should.
example: I start app/bot 1 and the cookies folder willl be set to \bot1\. When i use the webbrowser in the app all cookies are stored in the right folder. Now i start app2/bot2 the cookies will be stored in the \bot1\ folder and not in the \bot2\ folder. After i restart app2/bot2 the cookies are stored in the right folder. But now cookies from app1 are also stored in \bot2\.
I think i change the cookies folder the wrong way. Now my apps are changing the global cookies folder and not just for the app i choose.
If i use IE after i loaded app1 or app2, the cookies from IE are also stored in the \app1\ or \app2\ folder.
This is the code i use to change the cookies folder for app1:
This is the code i use to change the cookies folder for app2:
I put this code on 2 places to be sure
1.) below this line:
2.) and in the button code like this:
Am i on the right way? What to change?
example: I start app/bot 1 and the cookies folder willl be set to \bot1\. When i use the webbrowser in the app all cookies are stored in the right folder. Now i start app2/bot2 the cookies will be stored in the \bot1\ folder and not in the \bot2\ folder. After i restart app2/bot2 the cookies are stored in the right folder. But now cookies from app1 are also stored in \bot2\.
I think i change the cookies folder the wrong way. Now my apps are changing the global cookies folder and not just for the app i choose.
If i use IE after i loaded app1 or app2, the cookies from IE are also stored in the \app1\ or \app2\ folder.
This is the code i use to change the cookies folder for app1:
Code:
Dim key As Microsoft.Win32.RegistryKey = My.Computer.Registry.CurrentUser.OpenSubKey( _
"Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", True)
key.SetValue("Cookies", "%USERPROFILE%\APP1")
This is the code i use to change the cookies folder for app2:
Code:
Dim key As Microsoft.Win32.RegistryKey = My.Computer.Registry.CurrentUser.OpenSubKey( _
"Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", True)
key.SetValue("Cookies", "%USERPROFILE%\APP2")
I put this code on 2 places to be sure
1.) below this line:
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Code:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
RefreshIESettings(TextBox4.Text)
Dim key As Microsoft.Win32.RegistryKey = My.Computer.Registry.CurrentUser.OpenSubKey( _
"Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", True)
key.SetValue("Cookies", "%USERPROFILE%\APP1")
WebBrowser1.Navigate("https://WEBSITE-NEED-TO-SAFE-THIS-COOKIES-IN-CUSTOM-FOLDER")
End Sub
Am i on the right way? What to change?