# How are logins done?

**URL:** <https://forum.kirupa.com/t/how-are-logins-done/248382>\
**Category:** Uncategorized\
**Created:** [January 7, 2008, 7:59pm UTC](https://forum.kirupa.com/t/how-are-logins-done/248382 "2008-01-07T19:59:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peeki](https://avatars.discourse-cdn.com/v4/letter/p/7cd45c/32.png) [@Peeki](https://forum.kirupa.com/u/Peeki)\
**Post date:** [January 7, 2008, 7:59pm UTC](https://forum.kirupa.com/t/how-are-logins-done/248382/1 "2008-01-07T19:59:39Z")

</div>

im not sure how logins are made… i have created a object which has a function called login, when called it uses this-\>username and this-\>password to login, which is set by the \_\_construct… it then query’s the database for  
[SIZE=2][COLOR=#2a00ff][SIZE=2][COLOR=#2a00ff]  
SELECT \* FROM authUsers WHERE fldUsername=? AND fldPassword=?

[COLOR=black]So now im not sure what to do after this, do i create a session which carries this object in session vars, and using this-\>loged (boolean) within the object to check if the user is loged in on every page that requires login ?[/COLOR]  
[/COLOR][/SIZE]  
[COLOR=black]and is it safe to carry around the username and password in this object, which is carried around in the Session Vars…[/COLOR]  
[COLOR=#000000][/COLOR]  
[COLOR=#000000]Thanks in advance [/COLOR]  
[COLOR=#000000]( -Peeki :kir: :battery: )[/COLOR]  
[/COLOR][/SIZE]
