Sessions issue

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
Simmo
Forum Newbie
Posts: 6
Joined: Tue Aug 21, 2007 9:46 am

Sessions issue

Post by Simmo »

I'm a newbie, so please excuse my ignorance of php.

I have a php site which has a menu frame and a data frame.

The php site uses sessions and works great across both frames, but when I load this site into a frameset which is stored on another domain the session acts all wierd. On investigation I see this will happen :(

I'm doing this because ... my customer has a domain name and wants to point at my php site but have the address bar show his domain name, thus I have framed it.

If I log into the menu frame it understands the session variable which is great, but the data frame doesn't recognise the session variable, which I assume is because I'm across multiple domains.

The menu frame calls a JavaScript function to launch a URL into data frame. So, could I just pass in a variable which says I'm logged in and have the data frame pick up that variable from the URL and set the session variable in that frame? Is there any security risk in using this method?

... or does anyone have any other ideas?
Begby
Forum Regular
Posts: 575
Joined: Wed Dec 13, 2006 10:28 am

Post by Begby »

The best solution would be to not use frames, you are going to probably continue to run into problems.

If possible see if you can add a virtualhost for his domain on your server that points to the same site, then add / change the dns entry for his domain to point to your server.
Post Reply