Sessions not being passed to JS pop-ups...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Sessions not being passed to JS pop-ups...

Post by Burrito »

I just finished a calendar application and one of the features is the ability to filter events by the person who scheduled it. That "filter" is done in a pop-up window that is opened by js, they pick the filters they want and and they're added into an array which I set as a session var on the pop-up page. As soon as the filters are set, the pop-up closes and the parent reloads.

works like a peach on my machine BUT one of my users just tried it and something really weird happend. When he opened the pop-up, it asked him to log in again (so the session didn't carry over from the parent to the pop-up)...fine I can live with that. He logged in again, and went to set his filters, as soon as he set the filters, the session var got set, the window closed, and the parent refreshed, but the filters weren't set (obviously the session didnt' carry from the child to the parent either :? .

I could make it set the filters on the parent itself, but I really would like to know why this happens on his machine but not on mine.

I'm using win XP with IE 6. He's on w2k with IE 6.

obviously this has to be a browser setting, but I wouldn't know where to begin to look....?
any ideas/suggestions?

and dont' say use firefox! :twisted:
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

8O ¤Bump Bump¤ 8O
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

My guess is check your $_SESSION domain settings. If the parent opens in mydomain.com but the child in http://www.mydomain.com you might have trouble there. You can use session_set_cookie_params() to set the domain. Set it to .domain.com (front dot is important). Why it works on your system but not on the web I have no idea. Obviously the settings are sent to some other session and not the parent window's session.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

nah, it's all on the same domain.

Code: Select all

var bob = window.open('page.php');
...kind of thing... I checked to make sure he had cookies enabled and indeed he does, any other ideas?
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

Got no clues. Sorry Burrito. :(
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

I'll assume he's using IE - try setting the security settings really low. Before doing that though, try this page on some other computers. It may either be a fluke that your computer works, or a fluke that his doesn't - knowing that'll help you determine what to test.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

I'm assuming a fluke that his doesn't. I have tried on 4 other systems here in the office and hawleyjr even tested it for me yesterday and had success.

I basically turned his security settings off and still same deal...really weird stuff, major disturbance in the force for sure.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

What happens when you call print_r($_SESSION) from the pop-up window?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

don't you mean print_r[$_SESSION]...lmao.

empty array 8O
dyonak
Forum Commoner
Posts: 56
Joined: Wed Jun 22, 2005 10:22 am
Location: Minneapolis, MN
Contact:

Post by dyonak »

lol @ burrito =P
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

I know you didn't want to hear this but: Install Firefox on his machine

If it works then it's likely his IE. If it doesn't, it's likely his OS. Win2k might have some funky settings.

If it works everywhere but his computer, then it's likely something on his computer.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply