authentication - How does 's login system work?


i'm implementing login system similar of stack overflow in 1 of websites.

when login stack overflow, creates cookie named usr value.

if delete cookie, logged out...

so, can think uses sessions, in database, record user sessions.

is right? secure?

it's other built login/session system. when log in, system generates pseudo-random string identify uniquely - session id, gets sent out via cookie. when return, cookie sent so.

so takes value in cookie, looks in session system (could flat files, database, can't tell), finds session represented session id, , loads process request.

deleting cookie severs link between , site - on next visit, session cookie (which deleted) isn't sent, so has no way of identifying you, assumes brand new user, , doesn't show of "logged in" portions of site.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -