I want someone who visits my internationalized site to be able to change the language. I thought best way would be to store the language chosen in a cookie - so when the pag
You create your cookie within Application_BeginRequest() and add the results to the Response. It will be created on the client side only after the response has been sent back.
But you are reading the cookie value from the Request state, perhaps the original request before the response with the cookie has been sent back to the client? At this time within the life cycle however this cookie is not contained in the Request and thus is null.
Your client would have to send another request after the cookie has been created in order to make it available to the server and this makes perfect sense to me.
The reason that you can see the cookie in your web developer tools is, that the server will send the Response back to the client. However it will not be present in the current Request state, unless a new request with the cookie will be sent by the client.