Ninjakreborn Posted July 24, 2006 Share Posted July 24, 2006 Ok I know everything I need to know about basic sections, I already found out about having to use session_start();and it having to be the first line, I found out aboutsession_register()being deprecated, and that you should instead use$_SESSION['variablename'] = "whatever here";permanently instead of session register.I know how to check to see if a session is registered. I have a few quick questions now, what about session id's do I need to do anything with them, if so what. Should I go ahead and just do it with cookies, or do you think I should use a database, can I still use a database, and have the same affect, I just basically need a few pointed fingers. Quote Link to comment https://forums.phpfreaks.com/topic/15499-session-ids/ Share on other sites More sharing options...
AndyB Posted July 24, 2006 Share Posted July 24, 2006 [quote author=businessman332211 link=topic=101686.msg402613#msg402613 date=1153754755]Ok I know everything I need to know about basic sections ... I have a few quick questions now, what about session id's do I need to do anything with them, if so what. Should I go ahead and just do it with cookies, or do you think I should use a database, can I still use a database, and have the same affect, I just basically need a few pointed fingers.[/quote]The answers to the questions depend on what it is that you're trying to accomplish. Care to rephrase your questions into some sort of context? Quote Link to comment https://forums.phpfreaks.com/topic/15499-session-ids/#findComment-62908 Share on other sites More sharing options...
Ninjakreborn Posted July 24, 2006 Author Share Posted July 24, 2006 Alright1. If I just go with straight original sessions.I use session_start() at the top of every page, I set my sessions with the stuff I want.At the top of each name below that I put if whatever and password protect the page, does session_start() set an id automatically. basically is there anything at all I need to do to set an id, or to retrieve an id from a cookie, if I am just using standard cookies for the id's and files for hte session save locations.2. Now if I decided to use databases, is it like an alternative to cookies, do they like save the session id's in the database, and the session information in the files, I was wanting sessions to save normally but maybe save session id's in a database, so people don't have to have cookies enabled, because unfortunately a large part of our population doesn't use cookies.3. If I store all session information in the database, and session id then is there anything special I need to keep in mind, or anything extra I have to do to retrieve session information4. if I can and do store teh sessions in a file, and hte id's in a database, do I need to do anything more to retrieve the session id from teh database than I would need to do to retrieve it from a cookie5. Which is better/easier/more secure. Quote Link to comment https://forums.phpfreaks.com/topic/15499-session-ids/#findComment-62912 Share on other sites More sharing options...
wildteen88 Posted July 24, 2006 Share Posted July 24, 2006 [quote]1. If I just go with straight original sessions.I use session_start() at the top of every page, I set my sessions with the stuff I want.At the top of each name below that I put if whatever and password protect the page, does session_start() set an id automatically. basically is there anything at all I need to do to set an id, or to retrieve an id from a cookie, if I am just using standard cookies for the id's and files for hte session save locations.[/quote]sessions_start generates a session id automatically, if one hasnt been set. It wil also automaitcally resume a session if the session id is still valid.If you want to store your sessions within a database you have to create your own [url=http://uk.php.net/manual/en/function.session-set-save-handler.php]session handler[/url], quite complex if you are starting with sessions. However the defualt behavior of a session is fine. Quote Link to comment https://forums.phpfreaks.com/topic/15499-session-ids/#findComment-62915 Share on other sites More sharing options...
Ninjakreborn Posted July 24, 2006 Author Share Posted July 24, 2006 Alright then I will go with the standard way for now, after I do a few sites using that, and get a little more well rounded, then I will start working on dealing with things afterwards. And trying to do what I can about starting setting up my own Session Handling, this project isn't paying enough, and I need the basics, before I can jump to intermediate and advanced sessions. Quote Link to comment https://forums.phpfreaks.com/topic/15499-session-ids/#findComment-62932 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.