Page 1 of 1

Session Variables in Internet Explorer Frames

Posted: Mon Sep 05, 2005 11:00 am
by dominicshaw
I have a small problem with Internet Explorer (it works fine in Firefox) and tracking session variables. I have a website that does some stuff with PHP, but I disguise the true location of the website (hosted elsewhere on a PHP server) in a frame on my own website, that does not support PHP. When I enter the site some session variables are created that I use for a number of reasons, but when I leave the front page it looses these values.

I know the first thing that you will say is "Don't use frames", but unfortunately I have to disguise the true location of the files and a single frame is the easiest way I know!

Has anyone seen this before, and if so, have you found a way around it? Or has anyone got any suggestions on how to avoid this? I can't think of any way. Perhaps there is a way to associate the session cookie with a specific address? I imagine that the problem is that IE is associating the session cookie with the wrong website, and then can't find the information it needs...

Any help would be very much appreciated,

Thanks,

Dom

Posted: Mon Sep 05, 2005 11:09 am
by feyd
the session will be associated with the source of the frame, not your frontend site. Using Firefox, check to see what the settings of the cookie being used are. If the domain component or path component varies on the site, you will have issues unless the settings are right. Basically, you need to set the cookie to use .yourdomain.com (notice the leading dot), and your path to a single forward-slash. That will allow the cookie to transmit to all subdomains of your domain, and all paths on it.

Posted: Mon Sep 05, 2005 1:14 pm
by s.dot
a frame isn't really hiding the location anyway :P its just making it less obvious