Beauford Posted October 29, 2008 Share Posted October 29, 2008 Maybe someone can help me out here as I'm a bit confused. I have been reading about $PHPSESSID and the concensus is to turn it off, but how then can I retrieve the session ID in my scripts? Maybe related, but not sure - I had global_variables set to on and I was able to echo $PSPSESSID and there it was, I have just turned global_variables off and now I am not able to echo it. I also can't set sessions to use cookies only as I have login scripts that rely on sessions. Any help to clear this up, and how I should have things set up so I can get the session ID is appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/130607-phpsessid/ Share on other sites More sharing options...
GKWelding Posted October 29, 2008 Share Posted October 29, 2008 Using cookies for a login script is perfectly acceptable so I'm unsure as to why you reckon you can't use that method? Another very good method is to write your own session handler and store all of the information in a database instead. Personally I prefer this method. With both methods session data is stored, and accessed in an array called, wait for it...... $SESSION[]..... Seriously though, I would look up on Google about writing your own session handler and storing the info in a database, it really isn't as difficult as it sounds and it's mucho useful... Quote Link to comment https://forums.phpfreaks.com/topic/130607-phpsessid/#findComment-677594 Share on other sites More sharing options...
Beauford Posted October 29, 2008 Author Share Posted October 29, 2008 Acceptable, yes, but if the user has cookies turned off - they can't log in. I have looked at storing sessions in my database, but right now I don't have the time, and sessions won't be heavily used on my site, mostly for login and logout stuff, so not a huge concern at this time. I did mangage howerver to view the session ID, not sure why it didn't show before, but a simple echo session_id(); did the trick. I've been having some problems with the differences in the way my hosting server has things set up compared to my own server, and this was one of them. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/130607-phpsessid/#findComment-677606 Share on other sites More sharing options...
wildteen88 Posted October 29, 2008 Share Posted October 29, 2008 With both methods session data is stored, and accessed in an array called, wait for it...... $SESSION[] I think you meant $_SESSION not $SESSION Quote Link to comment https://forums.phpfreaks.com/topic/130607-phpsessid/#findComment-677647 Share on other sites More sharing options...
GKWelding Posted October 30, 2008 Share Posted October 30, 2008 With both methods session data is stored, and accessed in an array called, wait for it...... $SESSION[] I think you meant $_SESSION not $SESSION Yeah, that too... lol... Quote Link to comment https://forums.phpfreaks.com/topic/130607-phpsessid/#findComment-677995 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.