是否可以在Visual Studio调试会话之间保留cookie [英] Is it possible to persist cookies between visual studio debug sessions
问题描述
我有一个身份验证Cookie,该身份验证Cookie是在本地环境中单击登录屏幕后设置的.该Cookie已设置为永久性,并且已设置为7天的超时期限.
I have an authentication cookie that gets set after I hit a login screen in my local environment. That cookie has been set to be persistent and has been given a timeout period of 7 days in the future.
当我结束调试会话并在另一个版本之后开始调试时,cookie不存在.每种浏览器都会发生这种情况.有没有一种方法可以使Visual Studio在调试会话完成之后记住持久性cookie?
When I end my debug session and start debugging after another build the cookie is not present. This happens for every browser. Is there a way to get Visual Studio to remember the persistent cookie after a debug session completes?
推荐答案
我找到的解决方案是这样做,以使.NET Core MVC的新实例不会在全新的窗口中打开,而是在现有的窗口中打开.我更改了一个设置
The solution I found was to make it so that new instances of .NET Core MVC would not open up in a brand new window, but an existing one. I changed one setting
1)工具菜单 2)选项... 3)调试>常规 4)取消选中为ASP.NET启用JavaScript调试"
1)Tools menu 2)Options... 3)Debugging > General 4)Uncheck "Enable JavaScript debugging for ASP.NET"
当我使用F5运行应用程序时,实例会在chrome的现有实例中启动,并且我可以重用已经存在的cookie.选中该复选框,它将始终打开chrome的新实例,并且不存在cookie.
And when I run the app with F5 an instance fires up in an existing instance of chrome and I can reuse the cookies that are already in existence. With that box checked it always opens into a new instance of chrome and cookies are not present.
这篇关于是否可以在Visual Studio调试会话之间保留cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!