How to share cookie between IronPython and asp.net mvc in the same website? - asp.net-mvc-4

I got a very old website code, and it use IronPython in asp.net mvc. I found that when I call an ajax reques through IronPython Controller after an ajax request through asp.net mvc Controller witch set some cookie, the request in IronPython Controller dose not take the cookie.
So, is there some ways to share cookie between IronPython and asp.net mvc?
Can someone help me ?

Related

Can we write the .net core WebAPI in the asp.net core razor web page itself?

I have the following projects in my solution all .net core 5.0.
myproject.domain
myproject.infrastructre
myproject.webAPI
myproject.UI.Razorweb page.
Instead of using SPA which calls the webAPI, I am using razor web page which will call the webAPI(.net 5.0). My question is can we merge the webAPI and the razorwebpage into one? Can we write webAPI in the razor web page itself?
Is that allowed?
I agree with the suggestion given by Jeremy.
You should have a web API and Razor project separate.
Besides, if you would like to make some tests then you could refer to the articles below.
Use Razor Pages, MVC, And Web API In A Single ASP.NET Core Application
Hosting ASP.NET Core Razor Pages and Web APIs in a Single Project
Razor pages and webapi in the same project

Is there any way to use ASP.NET CORE MVC and WEB API together?

I am new to ASP.NET CORE and interested in how MVC and WEB API could be combined together? For example is there any way to use WEB API for back-end and MVC for front-end? The application should be simple CRUD app.
Easiest way is to create an MVC application.
Just create an api-controller inside and you have both!
A web api is just MVC, without the V, that is a model and a controller, no view.

how to post image from our application to linkedin post ? in c# Or in javascript

I am working on an asp.net MVC project and need to post image from application to LinkedIn.

What is the equivalent ASP.NET Web API Message handler for the ASP.NET MVC pipeline?

ASP.NET Web API has a very useful asynchronous message handler in the form of
System.Net.Http.DelegatingHandler.
I'm looking for the equivalent of such a handler to ASP.NET MVC. Is there something like that?
Note: I'm aware of Action Filters in both MVC and WebAPI, but that's not what I'm looking for.

Bestpractice ASP <-> WebApi which Auth / security model

I'm searching for bestpractices for auth in the given Internet Application scenario.
I've an ASP MVC 4 Webpage and an ASP4 WebApi.
Both are hosted on the same server but as independent applications.
The ASP MVC4 Application consumes via RestSharp the WebApi. Also there are some 3rd Party Desktoptools planed which will use the web api.
Now I'm thinking about how to authenticate the users.
My Idea is to use Forms Authentication for the ASP MVC 4 Site and Basic Authentication for the WebApi.
Is this an good idea ?
Or should i use a token based approach for the webapi ?
What are bestpractices / concerncs for this scenario ?
Many thanks in advance
Look at IdentityModel 4.0.
This is a security framework for ASP.NET Web API written by security experts.