Hi there yisroel6,
Welcome to WebmasterWorld Check this first => :[
webmasterworld.com ]
WRT $_SESSIONS : So long as you have session_start(); declared before you try to access the data stored in the $_SESSION, this is a pretty good way of storing information over sets of pages, though you can still do this using a database, but $_SESSION is the easier option to manage.
But saying that, it does depend on the context of the project that you have in mind, could you be a little more specific in what you are trying to do?
And, password/sensitive information shouldn't be passed un-encrypted at any time or for any reason, if you do, then this is highly dangerous, as potentially you could be letting your self open to abuse.
$_SESSION by default is only active once activated for around 25 mins, though this can be manipulated via the ini file, and $_SESSION is actually a cookie (check your cookie log, its called PHPSESSID) and should be treated as such.
I'm not sure whether there is any CPU/memory benefit between using $_SESSION or user defined vars, I have never looked into that ;)
And just reading your opening sentence again, login info should be hashed if you only use a $_SESSION, but not recommend, if you have access to a DB, use that... or if you haven't got a DB, you can use flat text file and store it outside the root of your domain, there is usually a folder called Private_html, you would just need to access it from absolute filepath, rather than URl - I hope that makes sense ;)
Cheers,
MRb