views:

254

answers:

4

The problem is that I have a PHP script (A) that does signup, authorize Twitter, then the twitter calls back to a return PHP script (B). In script (A), I set some $_SESSION variables, and in script (B) I will get it. Very straight foward. I have tested it on my computersss, and it all works. I can see the session variables in script (B) set by script(A). so as my friends. However, the most important thing is, my boss' computer cannot see it! that's the worst. he also tried on his computersss, still didn't work at his end.

I even reboot and restart the server, but still, situation remains the same.

So, my question is, is there any kind of restriction that the server cannot set the session on a computer? or,.. in which situation, the server will fail to set the session?

Server: Apache 2.2.3. Using Plesk PHP: 5.2.5

A: 

Since it’s the session that fails, check that the client uses the same session on every request and not a new one. Check if the session ID is carried along properly. If you’re using a session cookie, check its validity settings and see if the session cookie is accepted by the client. See http://stackoverflow.com/questions/1253984/php-session-cookie-problems-with-windows-xp-vista-ie-and-certain-users.

Gumbo
Murvinlai
+3  A: 

Maybe a stupid question, but anyway... does your boss block cookies on his computer?

If that were the case and for some reason PHP was set up to not 'fall back' to passing the session ID via the query string (or the redirect stripped it somehow), that may be a problem.

Narcissus
no. no block. i just check it.It is a problem that the sessionid changes. very weird.
Murvinlai
A: 

I do a test... both sessionid in Script(A) and Script(B) are the same for my computer. but when it is run in my boss computer, the sessionid are different. anyone know why?

Murvinlai
Do you mean that your boss's computer doesn't have the session ID from your computer? Or do you mean that your boss's computer doesn't have the same session ID when accessing both A and B on his own computer?
ceejayoz
+1  A: 

The session id is different on different computers because that's the idea behind sessions. You assign a number to each visitor (the session id) and by that number you can identify users and store information in each users $_SESSION array. This array is available only to that single session/user.

If you want something to store data for all visitors of your site, you might want to use a database or a serverside cache.

Tomas Markauskas