mraiur Posted March 20, 2008 Share Posted March 20, 2008 Hi. I was developing the site on my PC and when we uploaded on the host server one strange problem occur . I can only log-in on the site from one PC and whit all users . But if i try to log on from a diferent PC i notised that no sessions where able to be set . Why is that ? I used: session_start(); then for an example : $_SESSION['USER_NAME'] = 'someuser' Link to comment https://forums.phpfreaks.com/topic/97110-session-problem-multi-users/ Share on other sites More sharing options...
cooldude832 Posted March 20, 2008 Share Posted March 20, 2008 only one machine can be logged in at a time and only 1 user account or what are u trying to say? Link to comment https://forums.phpfreaks.com/topic/97110-session-problem-multi-users/#findComment-496890 Share on other sites More sharing options...
mraiur Posted March 20, 2008 Author Share Posted March 20, 2008 One user only, and only in one browser. and even if you logged off i can still only enter from this PC no mather what user. Link to comment https://forums.phpfreaks.com/topic/97110-session-problem-multi-users/#findComment-496893 Share on other sites More sharing options...
GingerRobot Posted March 20, 2008 Share Posted March 20, 2008 Your question is a bit vauge, but i would guess this is to do with the settings of the browser on the 2nd machine. Whilst you are using sessions, PHP will most likely (i say most likely, because it depends on your php setup) be setting a cookie to track the session ID. Therefore, if your browser on your second machine isn't accepting cookies, then no session will be kept. Link to comment https://forums.phpfreaks.com/topic/97110-session-problem-multi-users/#findComment-496894 Share on other sites More sharing options...
cooldude832 Posted March 20, 2008 Share Posted March 20, 2008 One user only, and only in one browser. and even if you logged off i can still only enter from this PC no mather what user. So what happens when another tries to log in? Sessions aren't machine dependent like cookies so to speak Link to comment https://forums.phpfreaks.com/topic/97110-session-problem-multi-users/#findComment-496895 Share on other sites More sharing options...
mraiur Posted March 20, 2008 Author Share Posted March 20, 2008 Okey i wil explain more. 2 PC one is main and one is a coworker's pc . if i log in the friend will not be able to set any sessions when he tries. if i am logged in whit FireFox i will not be able to log in whit Internet Explorer ( or otherlwise ) Link to comment https://forums.phpfreaks.com/topic/97110-session-problem-multi-users/#findComment-496897 Share on other sites More sharing options...
mraiur Posted March 20, 2008 Author Share Posted March 20, 2008 The strangest thing is that when i put session_start(); on the first line of index.php this is shown: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/autoserv/public_html/index.php:1) in /home/autoserv/public_html/index.php on line 1 any idia ? Link to comment https://forums.phpfreaks.com/topic/97110-session-problem-multi-users/#findComment-496987 Share on other sites More sharing options...
GingerRobot Posted March 20, 2008 Share Posted March 20, 2008 That error is because data is being sent to the browser prior to the call of session_start(); If, as you say, this is the first line of your file, i would expect there is some whitespace before the opening php tag. Link to comment https://forums.phpfreaks.com/topic/97110-session-problem-multi-users/#findComment-497061 Share on other sites More sharing options...
mraiur Posted March 20, 2008 Author Share Posted March 20, 2008 grr the problems where 2 1st i was setting the session_start a little bit below some code 2nd the encoding of the file its self was UFT-8 and it has to be UTF-8 Whithout BOM Thanks to all ! Link to comment https://forums.phpfreaks.com/topic/97110-session-problem-multi-users/#findComment-497073 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.