Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Membership.GetUser() vs Context.User

What are the differences between Membership.GetUser() and Context.User, and which is recommended for use in getting information about the current user?

like image 265
zimdanen Avatar asked Apr 29 '10 01:04

zimdanen


1 Answers

If you don't have membership configured for your site, getuser() won't yield anything.

Context.user is the identity token handed to the asp.net runtime, and will yield a user if any authentication aside from anonymous acces is configured fo the site.

like image 168
Pierreten Avatar answered Nov 03 '22 03:11

Pierreten