PDA

View Full Version : Frames and staying logged in to a SMF forum


Rich_A
10-02-2006, 12:39 PM
Hi again,

I posted this over at SMF communitty forums. http://www.simplemachines.org/community/index.php?topic=117468.0

I'm have a minor problem with staying logged in when I use frames to open SMF. If I open my forum in it's own window i.e open www.mydomain.com/forum I can browse the forum and it stays logged in.

What I've done with my site though is make 3 frames. 1 title frame at the top, 1 main big frame below and then of course the 3rd is the entire frame. This is using dreamweaver ..

In the title frame at the top I have a link for my forum. I link it to www.mydomain.com/forum and tell dreamweaver to open that window in the main frame. So you see the title frame stays unaffected and then the forum is loaded in the main frame. It looks and works great except for when I load the forum via the title bar it doesn't remember to login. I can log in but if I close it and then reload the site, it forgets to login.

I think it must be to do with my file structure. I have SMF in www.mydomain.com/forum and the dreamweaver site in root. Maybe if SMF and my dreamweaver site are both in root it will work? When I load my forum via my dreamweaver site, once the forum has loaded it doesn't say /forum .. still remains as the root address.

But if I put forum in root surely there will be a conflict as dreamweaver is in the root and has an index.htm .. really confused as to how to make this work, any ideas?

After thinking some more about it I think it's either a file structure issue or some thing that needs doing in dreamweaver.

It's like dreamweaver isn't creating a cookie when the fourm is loaded in the main frame.

domedia
10-02-2006, 01:19 PM
I honestly think it's a frame issue. Add it as reason #101 why you shouldn't use it. Seriously.

You can add the html in your top frame into the forum files instead and include it on all your pages :)

Rich_A
10-02-2006, 01:24 PM
Sorry that doesn't make much sense to me..

Are you saying it's possible? If it is, please explain exactly what I must do.

It does work and I can log in then browse when the forum is loaded in the main frame. It's just when I close the window, open a new window and open the site again it's not logged in.

Aghh I think I know what you mean but I wanted the dreamweaver title frame to stay because it has a load of links for many other things not only the forum.

I know I can open the forum in a new window but it would be cool to have everything in my site crammed under my title frame - which never changes. Atm the title frame and main frames I've made have a similar theme to the forum so it all ties in nicely.

domedia
10-02-2006, 01:38 PM
It might be that the frames are not causing this. I imagine you're starting s session for the user once they log in. Are you setting cookies or no? This is all guessing until you actually show us the exact url this is happening on.

Rich_A
10-02-2006, 02:16 PM
Are you setting cookies or no?

I've sent you a PM domedia.

What do you mean by setting cookies. In dreamweaver? I think in my PM it might be more clear what I'm trying to do.

domedia
10-02-2006, 03:09 PM
No private help I'm afraid, I most likely can't give you the answer anyways, someone in the community will though.

Rich_A
10-03-2006, 06:32 PM
37 veiws and no replies. Guess that means this is a dead end.

For such a simple thing I can't believe someone doesn't know how to make it work. Surely it's a cookie issue. IE is showing
w w w.mydomain.com so therefore perhaps the site decides it doesn't need to make or access a cookie.

Damn, quite a pathetic theory that. Joomla has a SMF component which allows Joomla porthole to incorporate SMF. I wonder how it does it, obviously with a frame type structure but with some extra stuff to deal with cookies.

Creative Insanity
10-03-2006, 06:55 PM
The reason is that login links, buttons whatever has a script connected to them and if you are not using that script then your login link cannot check cookies to see if you are logged in or not and hence you will be logged out since it cannot see the cookie.

Personally I think this is not a dreamweaver problem and your first target for your question is the correct one (simple forums website).
But really you are modding (sorta) the default layout for the package so I would say because of that fact you are on your own.
I don't think anyone here could help you.

Rich_A
10-03-2006, 06:59 PM
Hey..

Yea it seems like a bit of a void.

What I tried just now was linking a text word in main frame to open in main frame [_self] to my forum and it does login.

That's good enough for me as the title frame stays which is what I was after.

Doh, no it doesn't work same as linking from title frame. It initially logs in but then soon as I try to do something it logs out.

Aghh well you win some you loose some. :)

Creative Insanity
10-03-2006, 07:26 PM
PHPBB is far easier to do stuff like that as the login cookies are looked at by the link itself which finds the cookie.
Why do you want to use frames for anyway? Why not just use css/div and use an include for the forum index.php file and let that do all the work.
This is doable by all means.. just take another approach rather than frames.
Frames are horrid nasty things anyway. LOL

Rich_A
10-03-2006, 07:44 PM
Yea frames get alot of abuse but I like them.. they give a solid look but they are awkward for sure.

No idea what you're talking about with css/div .. I really don't know too much about text stuff and prefer to avoid it at all costs. It's hard enough learning GUIs.

BUT!!!!!!! I've cracked it anyhow. When I tried subdomains before I didn't actually install new forum on the subdomain. This was because the subdomain I made loaded the previous forum anyhow so I thought it was a subdomain but perhaps not.

Can't remember what I did before but just now I made new subdomain and installed new forum on it. When I direct title link to open forum on subdomain in main frame, it works! Stays logged in. Going to have to transfer my current forum now!!

For SMF there is option for admin in 'Features and Options' called Use subdomain independent cookies, this must be enabled to make it work.

Glad this is now possible using dreamweaver. And hurray for frames.. :D

domedia
10-03-2006, 07:48 PM
Yea frames get alot of abuse but I like them.. they give a solid look but they are awkward for sure. That's like using a stapler instead of a hammer. Frames has nothing to do with looks, it's somehting used only if you need to bring in more than one document in a frameset. For design/layout etc, see what CI wrote above.

But if they work for you, good on ya! :)

Creative Insanity
10-03-2006, 08:18 PM
and another one bites the dust LOL