I'm coding a site right now that is going to be a pretty big database site. So far I'm doing a lot of thinking and planning on paper to get all my ideas down but I seem to have run into a problem but it isn't too big.
Basically, what is the best way to keep users logged in?
I'm thinking session variables, but I haven't worked much with those but obviously am willing to learn.
Say they go to the login page, type in their Username/Password and does the DB check and its ok. Then it will bring them back to the main page and it should know they are logged in. Obviously I could do it through setting a variable login=1 but I don't really want to pass that through every link as it's not very 'me' friendly to code
I was thinking that maybe the way would be to store the login variable somewhere while the browser is open that it could check on each page and if it is 1 then display the logged in stuff, if not well then it wont.
When the browser closes, it gets rid of the 1 and its 0 now.
I know it's possible and with all the thinking I've been doing to plan this site out I might have overlooked something but I'd like some feedback and ideas. Tutorial links would be great too!
Also, I'm new to cookies aswell. Anyone care to show me a tutorial on saving user information in a cookie so they dont have to login unless they clear that cookie?
Thanks, I've been looking for a good PHP community to join and I'm hoping this is the one! It looks like it is!
jonas