|
I'm learning how to handle user login with sessions, I've read many things but it seems more complicated than everything makes it out to be. If someone has a good tutorial please share it with me (And don't just google one, I've already done that and still don't understand).
Here is how I want my site to work, to give you an idea of what I need done.
A user goes to my site, registers an account, downloads my software (It lets you upload screenshots and stuff), then they are able to log in and edit the files they upload. By "Edit the files" I mean change the title, add a description tags, and also view other peoples images and rate them etc. Much like the functionality of Photobucket, but with a different purpose.
Heres some questions that I have about sessions:
1. What kind of data should I store when a user logs in?
2. How do I determine when they leave the website? If I use a timer, where should I put it?
3. Are there any security holes I should be aware of?
4. Do sessions behave differently in different browsers, or are they server-side. I assume they aren't handled based on IP address, so how are they handled?
5. When a user deletes an image or changes something, should I verify the user? And if so, how?
6. I've read that you can give session's a different name, is this necessary? I read that they are handled automatically so you don't have to worry about it.
Thanks for any information, it's difficult to create something using a feature you don't quite understand.
Also, for security I read a sticky on this website somewhere about using hashes to encrypt passwords so you don't store the password on the server. When the user creates their account, using the date and time I create a unique ID and use that as the "salt" and put it on their MySQL data. Then they enter a password, I grab the salt, make the hash, and compare it. That works - but is it the right way to do it?
Last edited by RadGH; 02-23-2010 at 02:16 AM..
|