Forum Moderators: coopster

Message Too Old, No Replies

php javascript sessions and two browsers .

         

mschultem

4:14 pm on Sep 10, 2007 (gmt 0)

10+ Year Member



hi,
i am facing the following problem. would like to transfer a user (pid) from one php page to a second in a session variable.
between the two pages a javascript function opens a new window (with php inside):


newWind=window.open(pagename,\"survey\",\"height=\"+(screen.availHeight-60). toString()+\",width=\"+(screen.availWidth-30).toString() +\",scrollbars,status,resizable, left=2, top=2\")

i read up on the whole issue of server sided, client sided scripting and got everything to work fine using firefox 2.0.0.6 .
BUT
using IE the pid is not transfered.

i replicated the IE behavior with an older firefox version 1.6.

what makes FF2.0 special in comparison to IE?

anybody, any clue?

thanks a lot
m

[edited by: dreamcatcher at 7:11 pm (utc) on Sep. 10, 2007]
[edit reason] Fixed side scroll. [/edit]

Habtom

5:16 am on Sep 11, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



. . .would like to transfer a user (pid) from one php page to a second in a session variable.

What happens when you try to access the cookie?

No value? or the cookie won't be there any more?

Can you try making the cookie stay for sometime by adding a fixed time, and see it is not just dying with the new browser?

mschultem

10:30 am on Sep 11, 2007 (gmt 0)

10+ Year Member



hi,
thanks for your reply.

with IE (after print_r($_COOKIE);) I get:

Array ( [__utma] => 107603013.707199339.1189437586.1189437586.1189506472.2 [__utmb] => 107603013 [__utmz] => 107603013.1189437586.1.1.utmccn=(direct)Šutmcsr=(direct)Šutmcmd=(none) [PHPSESSID] => 8eab6a28532c16c960492ae78103290d )

with FF:

Array ( [__utma] => 107603013.1327435650.1168779328.1189502337.1189506457.407 [__utmz] => 107603013.1185539319.183.1.utmccn=(direct)Šutmcsr=(direct)Šutmcmd=(none) [PHPSESSID] => 1780a5891f05c63d46dd831fb3a3599b [__utmb] => 107603013 [__utmc] => 107603013 )

which does not tell me too much ... does it?

thanks again
m

mschultem

7:17 am on Sep 12, 2007 (gmt 0)

10+ Year Member



update: i realized that there are also differences in the $POST variables between using FF and IE ... this does not make any sense ...

mschultem

7:12 am on Sep 13, 2007 (gmt 0)

10+ Year Member



anybody, any idea on this?

help would be greatly appreciated!

thanks
m

jatar_k

3:05 pm on Sep 14, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



well it shouldn't have anything to do with the php, as it is server side, maybe take a look if you are using some js that isn't supported in IE

not sure what else to tell you

mschultem

9:02 am on Sep 18, 2007 (gmt 0)

10+ Year Member



that was actually my understanding - regardless of the browser if it works in one, it should work in all ...

the strange thing is that i can definitely reproduce the behavior of getting the values across in the session in one browser but not the other. i will check out the JS - thanks for the hint!
m

joelgreen

9:27 am on Sep 18, 2007 (gmt 0)

10+ Year Member



In FF:
echo PHPSESSID in original window
echo PHPSESSID in newly opened window

PHPSESSID should be the same in both cases

In IE:
echo PHPSESSID in original window
echo PHPSESSID in newly opened window

PHPSESSID should be the same in both cases

It looks like PHPSESSID is not the same in your case, when using IE.

I once had similar problem. From what i remember, there was a difference between opening window from the same browser (via File->New window), and running new explorer (via Start button). In one scenario it inherited PHPSESSID, in another case - started new session.

In order to fix i passed session id as parameter to the new window, and set cookie using javascript, something like document.cookie = "PHPSESSID=" + sessionid;

That was internal project (all users had same browser), so it was ok to use approach like that. Not sure if that will work in your case.

mschultem

11:58 am on Sep 20, 2007 (gmt 0)

10+ Year Member



hi
this was a very good suspicion!

FF keeps the PHPSESSION id and it changes in IE.

my problem is that i am not sure if i can follow your workaround. the thing also is that i would need a setup working on the internet (regardless of browser) and not only with one browser internal.

the basic behavior i need is just passing some variables from page A to page B where after clicking submit on page A triggers a second window to open in maximum size (determined by the monitor, close to maximum size is fine, too)

thanks
m