PHP Sessions, IE, and Frames

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
Iganorf
Forum Newbie
Posts: 10
Joined: Tue Dec 06, 2005 4:53 pm

PHP Sessions, IE, and Frames

Post by Iganorf »

I've recently created a php page that uses sessions to authenticate users. This page is held on a site that we'll call site1. I'm viewing the page inside a frame on site2 (I do this because I don't want the average user to see that the page they are viewing is actually coming from a different site).
In both IE and FF the page works fine while viewing it on site1. In FF the page works fine inside the frame in site2, but not in IE.
What gives? I know it's a cookie problem that IE doesn't want to accept cookies from the page inside the frame, but why and how can I get around this? Thanks in advance.
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

Post by phpScott »

server side session's
Or use a database to handle the sessions.
If both sites are yours then you will probably have access to the database from both sites.


Lots of tutorials around to do this.
:lol:
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

Is 'site2' your site, and more importantly, your content? From a moral point of view, and maybe even a legal (copywrite) POV in some places, this use of frames is a no-no if it is not.

Anyway, regardless of whos content it is, in order for the sessions to work on both sites, both sites must be on the same server, or more specifically have access to the same sessions cache.
Iganorf
Forum Newbie
Posts: 10
Joined: Tue Dec 06, 2005 4:53 pm

Post by Iganorf »

Yes, both sites are mine, and at first I also thought that sessions wouldn't work because they aren't the same site, but it works fine in FF, and with more testing I found that with IE set to Allow All Cookies it works fine. I'll look into server-side session handling, but I would really like to get this worked out.
Anyways, thanks a lot.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Post Reply