ASP.Net: How to log login-trys correctly? -
i have login in admin page.
now want log every login-try in database. normaly have log-table adminid in foreign key of adminuser-table.
now, of course, when try login username doesn't exist, haven't id , foraign-key uses crash in write-attamp.
now whats correct way log login-try when username isn't correct , haven't correct id?
1) add second log-table such things or 2) remove foraign key in first log-table
why not have adminid field nullable field? way, distinguish between successful , unsuccessful login attempts.
Comments
Post a Comment