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' Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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 ) Quote Link to comment 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 ? Quote Link to comment 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. Quote Link to comment 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 ! Quote Link to comment 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.