[eluser]alvaroeesti[/eluser]
just go directly to the userguide and get exactly the example they give you to work with sessions. Also you will need to set that up in the config file, some encrypted key for that to start working.
next, you just do your query in the model to see if the given username and password correspond to your table values, if yes, redirect to the dashboard. In that dashboard view page, just echo whatever value you want from the array of session values you created before.