I have a web site that is acting really strange and I'm not sure where the issue. The website is almost an exact copy of a previous website that still works.
For some reason the IsInRole is returning false even though it shouldn't.
I run this code:
FormsIdentity id = (FormsIdentity)HttpContext.Current.User.Identity;
FormsAuthenticationTicket ticket = id.Ticket;
// Get the stored user-data, in this case, our roles
string userData = ticket.UserData;
string roles = userData.Split(',');
Literal3.Text = roles;
// Checking for "System Administrator"
Literal3.Text += "|" + Page.User.IsInRole(roles).ToString();
Literal3.Text += "|" + HttpContext.Current.User.IsInRole(roles).ToString();
And it actually spits out: System Administrator|False|False
Which makes no sense to me, since I'm basically hard coding it to give out a response of true. For kicks I tested this on my app that works and I got True values. I've tried messing with IIS, scrubbing the Web.Config file and copying from my application that still works fine, and various other things. I'm down to the point where I'll likely end up re-creating the whole thing.
I'm hoping someone can give me a lightbulb as to why the IsInRole is acting up.