I have carefully crafted the start of an intranet site which requires sessions as user access control.
for some reason it works on the "localhost", but not across the network.
what have I missed?what do you mean it doesn't work? any errors? is it turned on? need to know more HKsorry - got all excited and forgot.
Basically, I can log-in through the browser on the server, and that's fine. The session holds, and I can navigate about.
The problem is when I start using a client PC. I log-in, I get told that the log-in is successful, and then I get dumped back to the log-in again - as if the session values haven't taken hold.
Is that clear? I don't really know how to explain it better...little better. are you doing it from a form? if so check the register_globals and see if they are on or off. if they are off you should use $_POST and not just the variable.I am using $_SESSION and $_POST
and it works when I work locally ("http://localhost/index.php"), just not across the network ("http://intranet/index.php")...is globals off then? make sure the ini files are pretty close to the same.they are the same, as I am using the same box in both cases - i am using "localhost" when I am actually tapping at the server keyboard, and "intranet" when I am at the other PC on my desk...ahh it shouldn't work that way. if you have apache setup as localhost it will not let you go out at the sametime. localhost is on each machine, it is local to that machine.
or did I not understand?
see if you are on teh server and type in localhost it menas that you are local to that pc only, not a intranet. you have to give apache a IP if you want it local to ALL machines (Intranet).i'm using IIS...
I have gotten completely confused...
Right, I have a site on a server, and I use "localhost" to browse the site on that server when I am using it.
Then I move to my other desk PC, and use the network name to access it.
Are you saying that I need to allow SESSIONS to be used by networked PC's?ahh you are using IIS, that could change things then. I don't know as I don't work with IIS. is there a setting for that? php doesn't work like that but as far as IIS then I have no clue.1. place head on desk
2. lift head approx. 3 inches from surface
3. allow head to drop rapidly
4. enjoy the satisfying thud
5. repeat ad nauseum
I found the problem hidden in the notes at php.net:
<!-- m --><a class="postlink" href="http://uk.php.net/function.session-start">http://uk.php.net/function.session-start</a><!-- m -->
The note by m dot kuiphuis at hccnet dot nl from 24-Jun-2003 08:37 covers the error.
Further reading:
<!-- m --><a class="postlink" href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;316112">http://support.microsoft.com/default.as ... -US;316112</a><!-- m -->
to sum up - no underscores in the url...
And my server name was SAL_tools cool, never would have thought.
for some reason it works on the "localhost", but not across the network.
what have I missed?what do you mean it doesn't work? any errors? is it turned on? need to know more HKsorry - got all excited and forgot.
Basically, I can log-in through the browser on the server, and that's fine. The session holds, and I can navigate about.
The problem is when I start using a client PC. I log-in, I get told that the log-in is successful, and then I get dumped back to the log-in again - as if the session values haven't taken hold.
Is that clear? I don't really know how to explain it better...little better. are you doing it from a form? if so check the register_globals and see if they are on or off. if they are off you should use $_POST and not just the variable.I am using $_SESSION and $_POST
and it works when I work locally ("http://localhost/index.php"), just not across the network ("http://intranet/index.php")...is globals off then? make sure the ini files are pretty close to the same.they are the same, as I am using the same box in both cases - i am using "localhost" when I am actually tapping at the server keyboard, and "intranet" when I am at the other PC on my desk...ahh it shouldn't work that way. if you have apache setup as localhost it will not let you go out at the sametime. localhost is on each machine, it is local to that machine.
or did I not understand?
see if you are on teh server and type in localhost it menas that you are local to that pc only, not a intranet. you have to give apache a IP if you want it local to ALL machines (Intranet).i'm using IIS...
I have gotten completely confused...
Right, I have a site on a server, and I use "localhost" to browse the site on that server when I am using it.
Then I move to my other desk PC, and use the network name to access it.
Are you saying that I need to allow SESSIONS to be used by networked PC's?ahh you are using IIS, that could change things then. I don't know as I don't work with IIS. is there a setting for that? php doesn't work like that but as far as IIS then I have no clue.1. place head on desk
2. lift head approx. 3 inches from surface
3. allow head to drop rapidly
4. enjoy the satisfying thud
5. repeat ad nauseum
I found the problem hidden in the notes at php.net:
<!-- m --><a class="postlink" href="http://uk.php.net/function.session-start">http://uk.php.net/function.session-start</a><!-- m -->
The note by m dot kuiphuis at hccnet dot nl from 24-Jun-2003 08:37 covers the error.
Further reading:
<!-- m --><a class="postlink" href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;316112">http://support.microsoft.com/default.as ... -US;316112</a><!-- m -->
to sum up - no underscores in the url...
And my server name was SAL_tools cool, never would have thought.