草庐IT

one_cookie

全部标签

c# - Facebook 登录抛出“应用程序配置不允许给定的 URL。: One or more of the given URLs is not allowed

我知道这个问题已经被问过很多次了,但是尽管我尝试了几个url地址,它似乎仍然会抛出这个错误。我正在尝试像微软教程中那样通过asp.netmvc应用程序登录facebookhere.当我在本地主机上检查它时它工作正常(Facebook中的站点URL设置为:http://localhost:55797/但是当我将应用程序上传到服务器后尝试检查它时,它给了我这个错误:GivenURLisnotallowedbytheApplicationconfiguration.:OneormoreofthegivenURLsisnotallowedbytheApp'ssettings.Itmustmat

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# - 流利的断言 : Assert one OR another value

使用流畅的断言,我想断言给定的字符串包含两个字符串之一:actual.Should().Contain("oneWay").Or().Should().Contain("anotherWay");//eitervalueshouldpasstheassertion.//forexample:"youmaydoitoneWay."shouldpass,but//"youmaydoitthisWay."shouldnotpass只有当两个值都不包含时,断言才会失败。这不起作用(甚至无法编译),因为没有Or()运算符。我现在是这样做的:boolisVariant1=actual.Contai

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

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

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# - NHibernate 3.1 NHibernate.Linq.NhRelinqQueryParser 异常 "Sequence contains more than one matching element"

我正在使用Nhibernate3.1/FluentNhibernate1.2当我使用CTRL+F5在Release模式下工作时,我没有遇到任何异常。但是在使用F5的Debug模式下会发生以下异常:此代码的控制台应用程序:_Session.Query().Where(x=>x.Bar=="bar").FirstOrDefault()异常(exception):System.TypeInitializationExceptionwasunhandledMessage=Thetypeinitializerfor'NHibernate.Linq.NhRelinqQueryParser'thre

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

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

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

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