草庐IT

cookie_secure

全部标签

c# - 如何删除 CookieContainer 中 1 个域下的 cookie

在System.Net.CookieContainer中如果我想删除某个域名下的所有cookies,怎么办? 最佳答案 你可以这样做。CookieContainerc=newCookieContainer();varcookies=c.GetCookies(newUri("http://www.google.com"));foreach(Cookiecoincookies){co.Expires=DateTime.Now.Subtract(TimeSpan.FromDays(1));}这将使您指定域的所有cookie过期。

c# - 如何在 Web API 授权属性中获取请求 cookie?

在.NET中有两个AuthorizeAttribute类。一个在System.Web.Http命名空间中定义:namespaceSystem.Web.Http{//Summary://Specifiestheauthorizationfilterthatverifiestherequest'sSystem.Security.Principal.IPrincipal.[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method,Inherited=true,AllowMultiple=true)]publicclassAut

c# - Asp.net 身份过期 session Cookie

我们正在使用MVC5.2和ASP.NETIdentity使用表单例份验证屏幕(用户和密码组合)进行身份验证的框架,并且使用cookie保留身份。我在身份框架的启动方法中进行了配置,将身份验证cookie的到期时间设置为30天,当用户选择“记住我”(IsPersistent=true)时,这很好用。当IsPersistent=false(用户选择不选择“记住我”)时,默认创建sessioncookie。此sessioncookie在InternetExplorer和FireFox中运行良好,当浏览器关闭时,cookie将丢失。在Chrome和Safari(可能还有其他浏览器)中,有一些选

[小程序云开发]security.mediaCheckAsync内容(图片视频语音)安全审核,云函数调用API方法

设计用户自行发布的图片、视频以及语音,都需要接入内容审核功能由于目前我只用了图片审核这一项,今天就给大家分析security.mediaCheckAsync有关图片内容的云函数调用API方法微信开发者文档(security.mediaCheckAsync)https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/sec-check/security.mediaCheckAsync.html1.在云函数文件右建新建Node.js云函数 2.在该云函数中的config.json添加OpenAPI{"permissio

c# - ASP.NET Core 2.0 预览版 1 : How to set up Cookie Authentication with custom login path

在ASP.NETCore2.0中,.UseAuthentication()中间件有一个重大更改,不再允许oldsyntaxmentionedhere去工作。新版本似乎在addAuthentication中处理配置,但我无法在任何地方找到任何关于如何更改指定自定义登录和注销url的旧代码的详细信息。services.AddAuthentication(o=>{//WherecanIspecifythis?????varopt=newCookieAuthenticationOptions(){LoginPath="/api/login",LogoutPath="/api/logout",}

c# - 如何在 CefSharp 中保存 cookie

我是CefSharp的新手。上周我在C#中使用CefSharp构建了我的第一个小程序。这是一个分屏程序。在一次拆分中,我加载了Tweetdeck。它工作正常,但Tweetdeck不存储cookie。每次启动程序时,我都必须登录。有没有办法保存cookies?varbrowser1=newCefSharp.WinForms.ChromiumWebBrowser("https://tweetdeck.twitter.com/"){Dock=DockStyle.Fill,};splitContainer1.Panel1.Controls.Add(browser1);

c# - 注册抛出 'Inheritance security rules violated while overriding member'

对于我的学校项目,我正在使用MVC项目附带的默认帐户Controller注册函数://POST:/Account/Register[HttpPost][AllowAnonymous][ValidateAntiForgeryToken]publicasyncTaskRegister(RegisterViewModelmodel){if(ModelState.IsValid){varuser=newApplicationUser(){UserName=model.UserName};varresult=awaitUserManager.CreateAsync(user,model.Pass

c# - Windows Phone 应用程序不发送 Cookie,但在 Windows 8 应用程序中使用相同的代码发送 Cookie

我有一个使用HttpWebRequest/HttpWebResponse发出GET和POST请求的基本类。我使用我的类登录API,然后请求数据。在Windows8“Metro”应用程序中,它完全按预期工作。在WindowsPhone8应用程序上,登录似乎成功,但在随后的数据请求中,没有发送任何cookie,服务器响应就好像客户端未登录一样。这是类,在Windows8应用程序和WindowsPhone应用程序中使用了完全相同的代码:classClass1{CookieContainercookieJar=newCookieContainer();CookieCollectionrespo

c# - System.Security.Cryptography 与 Windows.Security.Cryptography

我是一名新的Windows8开发人员,我有一些代码是为Linux设计的,但只要安装了GTK#也可以在Windows上运行。我目前正在将该应用程序作为现代UI(Metro)应用程序移植到Windows8。一切顺利,除了,当我尝试导入我的key派生代码(获取用户密码并从中派生key256位key)时,VisualStudioUltimate2013指示它无法识别usingSystem.安全.密码学。在查看Windows8开发者网站后,我发现有一个新类Windows.Security.Cryptography可用,但是,VisualStudio似乎也无法识别它。那么,既然你已经有了背景,我有

c# - .Net Core 中的 .AspNetCore.Antiforgery.xxxxxxx cookie 是什么?

我试图在.NetCore中使用ValidateAntiForgeryToken,但我得到的是.AspNetCore.Antiforgery.xxxxxxxcookie丢失。这个.AspNetCore.Antiforgery.xxxxxxxcookie是什么? 最佳答案 ASP.NETCore查找此cookie以找到X-CSRFtoken。TheValidateAntiForgeryTokenisanactionfilterthatcanbeappliedtoanindividualaction,acontroller,orgloba