Comments (7)
Can you describe a bit more what your setup is and what you are seeing? Ideally, a small repro would be helpful. I cannot reproduce this; i.e. the cookies show up (assuming I have accessed the backend at some point or enabled session locally). Here are the cookies I see in the samples in this project:
The required anti-forgery cookie "__RequestVerificationToken" is not present.
This is known and tracked here: #75
from systemweb-adapters.
@twsouthwick, not sure what else you need on the setup, please let me know. But whenever I'm on the new .net core site, and hit a URL that is proxied to the old .net framework site, I'm missing cookies. If I look at the request in the browser, in dev tools, it's missing the asp.net session cookie, request verification cookie and some custom cookies we set. Now I do see on the response the .net cookies are being set, but I end up with a new Session ID on each request. I have not setup Session sharing between the new .net core site and the old one. I'm guessing I need to setup session support before I start seeing the Session ID cookie?
from systemweb-adapters.
If you could provide a minimum viable repro so that I can try it out locally that would help. If that's not possible, sharing your Program.cs/Startup.cs for the core side (and any additional config you did on the Global.asax) would be a starting point.
The sample projects in the solution don't exhibit this behavior so I'm not sure what is missing.
from systemweb-adapters.
I'll try to create a whole new solution and share the code with you. Below is my program.cs for the core side. For the global.asx, you need it from the legacy .net frameworks site?
using Microsoft.AspNetCore.SystemWebAdapters;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSystemWebAdapters();
builder.Services.AddReverseProxy().LoadFromConfig(builder.Configuration.GetSection("ReverseProxy"));
// Add services to the container.
builder.Services.AddControllersWithViews();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Home/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.UseSystemWebAdapters();
app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
app.MapReverseProxy();
app.Run();
from systemweb-adapters.
Noticing other weird things. We have CspViolationException being logged and seeing these. Probably nothing to do with why I'm not seeing cookies, but just wasn't sure what it is.
M.Web.Http.CspViolationException:
DocumentUri="https://localhost:7266/cart/cart"
EffectiveDirective=""
ViolatedDirective="default-src"
OriginalPolicy="default-src https:; script-src https: 'unsafe-eval' 'unsafe-inline'; style-src https: 'unsafe-inline'; img-src https: data:; font-src https: data:; report-uri https://www.mdev.com:44333/mvc/cspreport"
BlockedUri="wss://localhost:44377/M_Web.Core/"
UserAgent=""
Referrer=""
StatusCode=""
SourceFile="https://localhost:7266/_framework/aspnetcore-browser-refresh.js"
LineNumber="234"
ColumnNumber="24"
ScriptSample=""
Mouser.Web.Http.CspViolationException:
DocumentUri="https://localhost:7266/cart/cart"
EffectiveDirective=""
ViolatedDirective="default-src"
OriginalPolicy="default-src https:; script-src https: 'unsafe-eval' 'unsafe-inline'; style-src https: 'unsafe-inline'; img-src https: data:; font-src https: data:; report-uri https://www.m.com:44333/mvc/cspreport"
BlockedUri="ws://localhost:2711/799c6d1bc1474deaa6f07091e478b347/browserLinkSignalR/connect?transport=webSockets&connectionToken=AQAAANCMnd8BFdERjHoAwE%2FCl%2BsBAAAA9XSQ9H%2BLL0WkY4VokVIEpwAAAAACAAAAAAADZgAAwAAAABAAAACHFAXH4tPU1vegZ3HhvEhxAAAAAASAAACgAAAAEAAAAENyxO2CdCyVboWy55ebn8soAAAA0pxplpd%2BJzj9u5ppVRZe54jM8tmRTypAM%2Bv3yqnyKeJ0rJIslFJLfBQAAACaJJHM11jl%2FL9DaaETrnJsdo2eGw%3D%3D&requestUrl=https%3A%2F%2Flocalhost%3A7266%2Fcart%2Fcart&browserName=&userAgent=Mozilla%2F5.0+(Windows+NT+10.0%3B+Win64%3B+x64%3B+rv%3A102.0)+Gecko%2F20100101+Firefox%2F102.0&browserIdKey=window.browserLink.initializationData.browserId&browserId=79ca-0aec&tid=10"
UserAgent=""
Referrer=""
StatusCode=""
SourceFile=""
LineNumber=""
ColumnNumber=""
ScriptSample=""
from systemweb-adapters.
I'll try to create a whole new solution and share the code with you.
That would be great, please create the repro and share it as a Github repo.
from systemweb-adapters.
@bsulliva I'll close this issue now since we haven't heard from you in a while. If you do create the repro and want to share it with us, please reopen the issue.
from systemweb-adapters.
Related Issues (20)
- Remove AD0001 suppression when updating to rc2 HOT 1
- HttpContext.Current should not be read-only HOT 4
- HttpRuntime.Cache throws "System.InvalidOperationException: No runtime is currently available" in unit tests HOT 14
- HttpApplicationMiddleware is used even not setting app.UseSystemWebAdapters
- Sharing Session State Between Webforms Application and Blazor Server Application - Current Problems, Future Design Goals
- Dependency Issue: Could not load file or assembly Microsoft.Extensions.Options HOT 1
- Update time provider to RTM when available
- Don't set content-type if not content HOT 2
- HttpPostedFile missing SaveAS method ? HOT 4
- Guidance on various IdentityModel implementations, and Session sharing for Blazor HOT 1
- Sharing Session between .NET Framework application and .Net7 application is not working HOT 12
- System.Web.HttpContext.Session is null with SystemWebAdapters v1.3.0 on .Net 8 after upgrading the 1.20 version on .Net 6. HOT 4
- Exposing GetService method inside HttpContextWrapper HOT 3
- Support `HostingEnvironment.MapPath` HOT 8
- gRPC clients cannot read messages when using services.AddSystem.WebAdapters() HOT 6
- API integration tests broken by 1.3.0 HOT 3
- Add `Redirect` and `RedirectPermanent` to `HttpResponseBase` and `HttpResponseWrapper`. HOT 2
- HttpResponseBase.Cache is typed incorrectly as HttpCachePolicy; Causes MissingMethodException
- Remote Authentication to ASP.NET running in Azure App Services Does Not Appear to Work - User return is always not logged in, IsAuthenticated flag is False HOT 1
- [Test Issue] This is a test issue to verify the GitHub automation marks the issue as needing triage HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from systemweb-adapters.