Don’t think it makes a difference with this but can you change your Services to return a DTOs or a Reference Type. For bool responses you could return an EmptyResponse when it succeeds and throw an error if it fails, or if you don’t want to return a DTO you can return a string, e.g. “true”.
Do you have .NET 5 installed? as it’s required by the dotnet tools. Otherwise I can’t see what’s interfering with ServiceStack Responses from here so would need a small minimal repo I can run locally to repro the issue to be able to investigate further.
What’s the BaseURL of your Service? It expects https://localhost:5001/metadata/app.json to exist, if you’re mounting ServiceStack at a different path that needs to included so that {BaseUrl}/metadata/app.json returns a valid response then you can use:
On the asp.net core application there’s first a js api from the react app to the .net part and then the .net part communicates with the webservice and hands back the data to react.
I made a new service with no auth required like so:
Also if you implement Post() for your Service implementation than you need to use the POST HTTP Method, if you use Any() or Get() you can use GET. The behavior is expected.
Before we were looking at the requests from js api to .net where the set-cookies weren’t showing up.
.net to webservice requests weren’t showing up anywhere when I ran the .net application with HTTPS specified in the run/debug config, but do show up now that I just have HTTPS specified in the code and run it with HTTP in the run/debug config.
I do not see allowOriginWhitelist set anywhere but adding the plugin leads to this error: System.ArgumentException: An item with the same key has already been added. Key: Access-Control-Allow-Methods
It should only return new Cookies on Authentication, not every request.
The cookies also need to be sent with the Request to not return new cookies, if that’s the issue you need to work out why the request isn’t sending cookies (e.g. SameSite Cookies).
I’m trying to save some data in the session from one request and use it while handling another request, but an auth requests will happen between these and cause new ids to be set so I can’t get the data.
All my services have [Authenticate] on them.
How exactly do I set GenerateNewSessionCookiesOnAuthentication = false? I’m just getting Cannot resolve symbol 'GenerateNewSessionCookiesOnAuthentication' trying to set it.
Sorry I had to do something before I could finish testing with the new setting.
The auth requests are still giving back new ids every time even with GenerateNewSessionCookiesOnAuthentication = false set, I must have clicked a wrong request earlier.