i use vue js 2 and asp.net core 2.2 on my project I use origin cors on my app and set my vue js development address to WithOrigins and on front side set {withCredentials: true } on very request
services.AddCors(o => o.AddPolicy("AllowAll", builder =>
{
builder
.WithOrigins("http://localhost:8080")
.AllowCredentials()
.AllowAnyMethod()
.AllowAnyHeader();
}));
set startup to use session properly like this on ConfigureServices
services.AddSession(options =>
{
options.IdleTimeout = TimeSpan.FromMinutes(10);
});
and use it
app.UseSession("AllowAll");
when authentication successfully with front side I must save loged in user on session and other request I need to save object on session and return on another request . I try to setString - setting and ... but when I send another request the session id changes per request and I not able to get what set on last session . any idea for another way to save status of user on something like session? I used ImemoryCache but I don't know abou life cycle or is generate unique id for every user ? any way to use session ?( I know the restful api communicate with token but I need that )