Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Aiheen aloitti: helenbpd - tammikuu 31, 2005, 02:06:15 AP

Otsikko: nobody can log out (con't) - cookie widget issues - help?
Kirjoitti: helenbpd - tammikuu 31, 2005, 02:06:15 AP
Welcome to SMF California ... where you can log in, but you can never leave ...  tra la la ...

Just upgraded to 1.01 from RC2 tonight.  Host upgraded our PHP & Zend yesterday.  Problem: folks cannot log out now.

Clicking on logout button returns logged-out page, but any return to 'home' or other forum page returns logged in.  After deleting cookies & closing browser, still logged in (this I really don't understand?).

Hunted through all the cookie threads here and have tried checking subdomain / local / neither and all combinations of the above.  Cleared cookies/closed browser between each.  Can't log out in Firefox, Safari, Opera, IE, Camino, Netscape, etc etc.  Neither can my IE users.

Totally perplexed.  Kinda major personal security issues for many of my members, so I need to get this resolved asap.  I'm really sorry to post yet another cookie thread ... but ... help??

http://www.bpdcentral.com/nookboard/phpinfo.php
Otsikko: Re: upgraded and now nobody can log out - help?
Kirjoitti: [Unknown] - tammikuu 31, 2005, 02:51:39 AP
A test account would be greatly useful.

-[Unknown]
Otsikko: Re: upgraded and now nobody can log out - help?
Kirjoitti: helenbpd - tammikuu 31, 2005, 03:18:07 AP
Sure thing:

name: testing
pswd: onetwothree

thanks! :)
Otsikko: Re: upgraded and now nobody can log out - help?
Kirjoitti: [Unknown] - tammikuu 31, 2005, 03:25:50 AP
Something is setting the cookies on every page view, including after you log out.  Have you made any custom cookie related modifications?

-[Unknown]
Otsikko: Re: upgraded and now nobody can log out - help?
Kirjoitti: helenbpd - tammikuu 31, 2005, 03:26:08 AP
just fyi, current settings:

local: no
subdomain: yes
META: no

Otsikko: Re: upgraded and now nobody can log out - help?
Kirjoitti: duddits - tammikuu 31, 2005, 03:28:28 AP
this problem looks a like mine

My users cant log in because of the cookies lol

the place where u can go when u want but u cant go in lol :-\
Otsikko: Re: upgraded and now nobody can log out - help?
Kirjoitti: helenbpd - tammikuu 31, 2005, 03:29:56 AP
I changed the SMF cookie name to Nookcookie12 about half an hour ago.

Yes!  I have a javascript widget in there that sets a cookie:
 
http://www.bpdcentral.com/nookboard/Themes/CURRENT/fontsizewidget.js

(I don't know if you remember me, [Unknown], I was the one who couldn't get that darned fontresizing cookie to stick.  This is a different code than the one I was trying back then, but perhaps my cookie problems are all indicative of a similar server glitch?  or not.)
Otsikko: Re: upgraded and now nobody can log out - help?
Kirjoitti: [Unknown] - tammikuu 31, 2005, 03:39:17 AP
Lainaus käyttäjältä: helenbpd - tammikuu 31, 2005, 03:29:56 AP
(I don't know if you remember me, [Unknown], I was the one who couldn't get that darned fontresizing cookie to stick.  This is a different code than the one I was trying back then, but perhaps my cookie problems are all indicative of a similar server glitch?  or not.)

Don't worry, I'm not quite that daft or old :P.  I remember things for a bit longer than a day.

This function here:

window.onunload = new Function (this.name+'.setDocumentCookies();');

Is resetting the cookies for the page on every page view, including the login cookie.  I would say it should only set the cookies when necessary.

Lainaus käyttäjältä: duddits - tammikuu 31, 2005, 03:28:28 AP
this problem looks a like mine

My users cant log in because of the cookies lol

the place where u can go when u want but u cant go in lol :-\

I'm quite certain your issue is different.  Please start a new topic - and try searching a bit more for similar issues.

-[Unknown]
Otsikko: Re: upgraded and now nobody can log out - help?
Kirjoitti: helenbpd - tammikuu 31, 2005, 03:46:31 AP
Lainaus käyttäjältä: [Unknown] - tammikuu 31, 2005, 03:39:17 AP
This function here:

window.onunload = new Function (this.name+'.setDocumentCookies();');

Is resetting the cookies for the page on every page view, including the login cookie.  I would say it should only set the cookies when necessary.

I would say it should, too, if I could speak Cookie.  Happen to know how I recode that?  (is there a .setDocumentONLYTHISCookieYOUDOOFUS kinda command?)

Helen (who actually does have trouble remembering yesterday ... but in a charming, blithery ADD sort of way)
Otsikko: Re: upgraded and now nobody can log out - help?
Kirjoitti: helenbpd - tammikuu 31, 2005, 12:38:51 IP
Any cookie experts out there?  I tried commenting out the whole line, but obviously that just resulted in the cookie not being set for any new page, which is undesirable (font change should persist throughout site).

How to change
window.onunload = new Function (this.name+'.setDocumentCookies();');
in my fontsize widget js so that it only affects the fontsize cookie and not the SMF login cookie?
Otsikko: Re: upgraded and now nobody can log out - help?
Kirjoitti: Oldiesmann - tammikuu 31, 2005, 12:42:42 IP
Can you post a copy of the setdocumentcookies function?
Otsikko: Re: upgraded and now nobody can log out - help?
Kirjoitti: helenbpd - tammikuu 31, 2005, 02:52:04 IP
I'm not entirely sure which part of the whole js script is relevant, it might be this?
Cookiemanager.prototype.setDocumentCookies = function() {
var expires = '';
var cookies = '';
var domain = '';
var path = '';
for(var name in this.cookies) {
// see if there's a custom expiration for this cookie; if not use default
expires = (this.expiration[name])?this.expiration[name]:this.defaultExpiration;
// see if there's a custom path for this cookie; if not use default
path = (this.path[name])?this.path[name]:this.defaultPath;
// see if there's a custom domain for this cookie; if not use default
domain = (this.domain[name])?this.domain[name]:this.defaultDomain;
// add to cookie string
cookies = name + '=' + this.cookies[name] + '; expires=' + expires + '; path=' + path + '; domain=' + domain;
document.cookie = cookies;
}
return true;
}


but the setDocumentCookies appears in a few other places, too.
The whole js document is longish so I'll link it:
http://www.bpdcentral.com/nookboard/Themes/CURRENT/fontsizewidget.js

This is in the index.template.php right after the body:
<body><script type="text/javascript" language="JavaScript1.2">
if (fontSize) fontSize.fontSizeInit();
</script>


and this where the actual buttons appear in the index.template.php:

<script type="text/javascript" language="JavaScript1.2">
if (fontSize) document.write(fontSize.allLinks);
</script>

Otsikko: Re: upgraded and now nobody can log out - help?
Kirjoitti: helenbpd - helmikuu 01, 2005, 05:41:01 IP
...anybody have a tip?  This cookie was severely interfering with my SMF cookies, so I just took the whole darned widget out.

There are other options, like an ALA-type CSS styleswitcher, but I really liked this particular version of the font resizer since it's very flexible & can scale to a large range up/down, unlike a CSS stylesheet switcher (I make my stylesheets in font%'s, so it wouldn't be hard, but lots of extra uploading & naming, bleah.  And now I have a fear of any other widget cookies having the same bad effect.). 

If I'm doing a CSS switcher, I guess I could also just automate the regular SMFtheme-swtiching function from a front-page menu.  Main issue preventing me from just giving up & referring members to the layout prefs:  we have many guests who don't register (for valid reasons & we encourage browsing), so I really want to make this function membership-independent.  It'd be OK if the selections don't stick cross-session.


So: to make a long whiny post short:

1. can someone help me rewrite this cookie function so that it doesn't interfere with SMF cookies, or
2. Does anybody here have a functioning style/theme switcher they'd care to share with me?

H