Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/130607-phpsessid/
Share on other sites

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...

Link to comment
https://forums.phpfreaks.com/topic/130607-phpsessid/#findComment-677594
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/130607-phpsessid/#findComment-677606
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.