user authentications via session or cookies?

TD1

New Member
This moment if user enter's correct username and password i just simply creating session:\[code\]$_SESSION['userid'] = $user_data[0]->id;$_SESSION['username'] = $user_data[0]->username);$_SESSION['loggedin'] = true;\[/code\]After that, with $_SESSION['loggedin'] i can check if user can view part of website or not.Is this method 'good/safe' ?
  • Any benefit's using cookies based and session based authentication ?
  • Which method most common site's using ?
  • What you guys using for your sites ?
 
Back
Top