I'm using a default _Layout.cshtml for my layout.
Now, I would like to access the Request object, so I could read the Cookies collection, so I could see if user is logged in. How can I achieve that, since the _Layout view doesn't have a Controller? I thought about creating a model for the _Layout view, but the model can't access Request as well. Any thoughts?
Use @HttpContext.Current.Request
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With