Jump to content

PHP session problems

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
welton122

welton122

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts
hi all,

ok i have created a site (Jake Welton) which uses PHP sessions to login and out. My problem is that everything works fine but when people try to connect to the site (and login) they seem to swap accounts (this is because the session contains a unique number which corresponds to the data which is returned to the user e.g. the user name next to he logout button), i am unsure how sessions can get mixed between browsers like this?????

Now heres the part which gets really strange, if two people both use explorer or Firefox then it messes up but if one person uses explorer and the other Firefox then it works fine. Is it possible that the browsers are getting their cookies (session cookies that is) from the server?????? if so how can i change this to make it work??

Basically i need a way of fixing this as it is a big problem at the moment.

Many Thanks,
J

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
I would begin to think your problems relate to a poor host configuration (erroneous php.ini or apache host config with session_save_path), can you replicate the problem again but adding this to your script?
echo 'My Session ID: ' . session_id() . '<br/>';
If session IDs are the same on separate clients (i.e. different computer) then it is a huge problem in itself as the server is confusing clients. It can be fixable but it is best to find what exactly is the problem first.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#3
welton122

welton122

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts
Thanks the problem was with my server