authentication with Formsauthenticationticket

Asked

Viewed 24 times

0

I need to make the persistence of inclusions, changes and exclusions that users make on the system, each drive that the user only sees, so I created a Id on the tables of my BD to know which user is recording the data.

I was using the Session, when the user logged in I assigned Session with the Id of the user on BD, this caused several problems because the IIS ago Recycle of pool and clears the data of Sessions.

So I decided to use the FormsAuthenticationTicket since I can use the role in the user_data, and the login, but I cannot assign the ID user, so I created a Select in the DAO that returns the ID of my user with filter on login_name which is unique. But I realized that it slowed down Session, for obvious reasons.

  1. I would like to know if this is best practice? or
  2. if there is a better solution?

1 answer

0


You can use a base class with attributes clientId, createDate, lastDate, isDeleted to have the control that is editing or creating, but in this case will always be the last edition made

If you want all the details of CRUD you need to make a log system

  • But how would I access these attributes in my CRUD? I would instate the base class in the controller, I would pass the Ids up to there ok. My question is how would I access this information in the CRUD class? I understand that I could not use Static.

  • base class is not for controller but for objects(entities), db needs to be modified to support the first option, if you use Migration and only implement the base class and run Migration

  • and in the CRUD part Voce need to create an override or even edit, to save lastdate and userid

  • if you have difficulty in this part, better create the log system, every time the crud is used you make the call to log() to save what was done

  • Thank you Hudson.I will study this implementation.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.