• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 853
  • Last Modified:

How to secure AJAX call to my controllers in an MVC 5 website with authentication?

I am building a MVC 5 website with authentication. I will decorate my controllers with the [Authorize] tags.  I wanted to incorporate KnockOutJs with my grid so my question is "How will KnockOut interact with the secured controllers?". Is it possible to pass the cookie with the AJAX calls?
matthew phung
matthew phung
1 Solution
käµfm³d 👽Commented:
Knockout won't interact with your controllers...JQuery--if you're also using that--will. Knockout's purpose in life is to keep your UI fresh with changes to the underlying data (on the client side). If you use JQuery's AJAX functionality, then it should send cookies also--provided the URL you are calling is on the same domain as the main page.
matthew phungAuthor Commented:
ok.. I'm using jQuery and just want to make sure that the authentication cookie get sent back to the server. Thank you

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now