R – Using ASP.NET Membership Cookie in Web Service

asp.netasp.net-membership

I have an ASP.NET 3.5 site that exposes web services as part of the web project for jQuery HTTP/POST calls to access. The site is using forms authentication. I currently have the web services denied to anonymous users. By using Firebug, I can see the ASPXAUTH cookie coming across on every web service call from jQuery, and I would like to use it to fetch the membership user from my ASP.NET membership database in the web service code. Is this possible? I'm having trouble both finding how to access a cookie on an HTTP/POST in the web service code & how to take that cookie and get the membership user.

Best Answer

Looks like it's a simple as just using Membership.GetUser();! I was having a brain fart and not realizing that it was that simple.

Related Topic