1 Replies - 1628 Views - Last Post: 18 October 2013 - 08:32 AM Rate Topic: -----

#1 tieugiang94  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 160
  • Joined: 07-December 11

Should we use User.Identity property ?

Posted 14 October 2013 - 10:46 AM

why User.Identity.IsAuthenticated read only ?
Should i use User.Identity to manager login status ? How to do that ?

This post has been edited by tieugiang94: 14 October 2013 - 10:48 AM

Is This A Good Question/Topic? 0
  • +

Replies To: Should we use User.Identity property ?

#2 h4nnib4l  Icon User is offline

  • The Noid
  • member icon

Reputation: 1267
  • View blog
  • Posts: 1,794
  • Joined: 24-August 11

Re: Should we use User.Identity property ?

Posted 18 October 2013 - 08:32 AM

To briefly answer your question, you can't programatically set User.Identity.IsAuthenticated because that property is a function of whether or not the user is authenticated. That would be a bit like allowing a cook to mark orders as "complete" with no regard to where in the cooking process they are. You wouldn't let a cook say an order is "done" when he or she hasn't even taken the ingredients out of the refrigerator, nor would you allow the maitre'd to mark an order as incomplete after the customer has already eaten it.

It seems like you need to find yourself a good tutorial about ASP.NET authentication, and maybe the ASP.NET membership provider (which will be good enough for you until you know enough to make your own).
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1