❔ Can't get Cookies Response from .net api
Hi, I figure how to get my auth cookie from the result of the Login of my Controller. I use Asp.net Identity to login my User. Here a shortcut of my endpoints to login my User and The cookie I get on the brower on the response. I wan't to include it on my "LoginResult". Ty for the help 🙂
7 Replies
Why do you need to get it manually?
The auth middleware should just use it and that's it
Cause I have an angular application for the front of my website and the cookie give by Identity can't be catch with javascript so I need to catch it after the successfull login and add him to the response to store it on my localstorage. The principal reason I wan't to do that is to make the website remeber the user connected after his closure by storing it on the localstorage. Like that I when the user has check the "Remember Me", the website already know the user even after his closure until the user disconnect by himself
You can still use the auth middleware for that
Just set the cookie to not expire too soon
Yes but how the front part of my website is supposed to know if the user who had connection before the closure is supposed to be logged or not ?
The requests sent to the backend will go through
That will mean the user is authenticated and logged in
Ok I will check this. Maybe I just doesn't know the middleware for this thing. Tu for the help
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.