php - user authentications via session or cookies? -


this moment if user enter's correct username , password creating session:

$_session['userid'] = $user_data[0]->id; $_session['username'] = $user_data[0]->username); $_session['loggedin'] = true; 

after that, $_session['loggedin'] can check if user can view part of website or not.

is method 'good/safe' ?

  • any benefit's using cookies based , session based authentication ?
  • which method common site's using ?
  • what guys using sites ?

have @ great answer joel coehoorn on page . of questions answered in post.

web authentication state - session vs cookie vs?

i hope help.

cheers


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -