So, I started to develop a website on my local server...
I wrote a Register/Login system with a MySQL database, in PHP. I know that i have to use sessions for it, but i dont really understand them.
- If i just start a session without an ID, it will generate a random ID?
- As I think, I should generate the ID and start the session after the SQL checking (pw and username) but before it throws the user to the next page. Am I right?
- Once I generate it as I mentioned in those questions, Should I store it in a SQL table or something?
- Will they die automatically or I have to kill them somehow? (except the manual logout page by the user click) I've read somewhere that they will die by the time, but as I think I have to set it up somehow.
- Where are they??? (I know, this is a highly retarded question) They are in the client or the server?
Yeah... I know, I should do something else... Well, I just need a source where they are documented for this kind of usage, or a description like this: Generate -> store -> check every time when the page changes -> they will kill themself automatically.