tips and tricks for movable type

remember me misbehavior
January 31, 2003

This isn't really an "MT Bug", but I needed a category to put it in. :sorry:

I'm having problems with my Remember Me function that I just can't figure out. Here's what I posted about it over on the MT support forum.

Surprise! The girl who too often helps others can't seem to help herself! :tongue:

I noticed my "remember me" function is only kinda sorta working. What it's doing it setting a cookie not for my site (www.thegirliematters.com/) but for the archive directory (www.thegirliematters.com/tips/archives/0211/, for example).

I'm remembered on pages in that archive, but not anywhere else, unless I, of course, check "remember me" again while on a page in *that* archive. Grrrrr.

I'm using the Scriptygoddess subscribe to comments script, but I have no idea if that is impacting this or not (I really don't see how it could be, but then again, maybe I just need a new pair of eyes).

Any suggestions as to what I've effed up? I just can't figure out why it sees the archive path as the HOST.

:banghead:

Comments

Testing the "Remember me" from the popup window.

by girlie | 01.31.03 08:10 PM

Okay - that cookie got set for my path to MT!! (because that's where mt-comments.cgi is)

Damn.

by girlie | 01.31.03 08:12 PM

shoot! I just commented on the entry below this and I was going to click the remember me!! I always, always forget. I'm going to do it this time...

by bmk | 01.31.03 08:45 PM

Okay, I clicked it and it remembers me, I browsed to /blog and it knows me!

by bmk | 01.31.03 08:50 PM

Well hell. I don't get this at all.

Are you sure you didn't already have a cookie for the blog?

I opened my cookies folder and immediately checked the new cookie added when I clicked "remember me". The cookie file name was girlie@mt; the others were like girlie@0301, girlie@0212 (the last archive folder in the path).

Harrumph.

I wonder if this is a ZoneAlarm thing? I have my domain added as a trusted site though. =(

If it's just me this is happening to, I won't worry too much. I just didn't want it affecting visitors.

by girlie | 01.31.03 08:55 PM

i'm having that problem on a lot of people's blogs, including my own..

by eska | 02.01.03 03:30 AM

but apparently not in yours :-) worked fine for me...

by eska | 02.01.03 03:31 AM

Okay...I guess I'll stop worrying now!

by girlie | 02.01.03 03:34 PM

I will tell you this, though - I read awhile back that if you set the domain of the cookie to ".domainname.com" as opposed to "www.domainname.com" or "domainname.com" it seems to work better on certain browsers. I'm not sure why, and I forget which browsers had a problem with the other two ways of doing it.

In any case, I noticed that your "HOST" is set WITH the "www" - don't know which browser you're using, but maybe that's what the problem is?

(I'm also going to test the remember me function for me here with this post)

by Jennifer | 02.04.03 02:07 PM

It remembers me (i'm in the pop up) but (FYI) I just got this error on here when posting the last comment:

An error occurred:

Rebuild failed: Building entry 'remember me misbehavior' failed: Build error in template 'Individual Entry Archive': Error in tag: Can't find included template module 'PHP_T connect'

Maybe you're testing some code or something... just wanted to let you know :)

by Jennifer | 02.04.03 02:09 PM

Now i'm on your permalink page... And it doesn't remember me. I viewed your source and I noticed that all the "cookie" code that was on the pop up page ISN"T on this one (unles it's in one of the .js files you're including...) That would be why it doesn't show up when you're on the permalink page... it needs to know what to do to "getcookie()" ... the definition of that function (and the other cookie functions) don't appear to be on your ind. entry pages...

by Jennifer | 02.04.03 02:13 PM

Thanks Jennifer - I fixed that module problem, I was trying to clean out some modules to speed up the rebuilds and I guess I got carried away!

And yes, I had moved the JS stuff into a separate file (again, trying to streamline) but maybe I'll move it back on the offchance that it's related to the problem.

Thanks again, little things like this can drive a girl to drink! =)

by girlie | 02.04.03 07:30 PM

Test comment again.

by girlie | 02.04.03 08:48 PM

girlie I forgot to tell you, I looked in IE6 at my work and it looks goooood!

hey and, did I sign any comments with 'brenna' instead of bmk? I must've because why the heck ain't I on your most comments list yet? :P

by bmk | 02.07.03 10:22 AM

It sounds like things are working. I just wanted to say I love the head banger smiley.

by David | 02.14.03 01:30 PM

I think Adam Kalsey's post in this support forum thread may hold the fix.

Change:

setCookie('mtcmtauth', f.author.value, now, '', HOST, '');
setCookie('mtcmtmail', f.email.value, now, '', HOST, '');
setCookie('mtcmthome', f.url.value, now, '', HOST, '');

to:

setCookie('mtcmtauth', f.author.value, now, '/', HOST, '');
setCookie('mtcmtmail', f.email.value, now, '/', HOST, '');
setCookie('mtcmthome', f.url.value, now, '/', HOST, '');

We'll see after I post this comment!

by girlie | 03.08.03 11:16 AM

have you had any luck with this yet? I am having the same problem. I've made all the changes you've noted above and in the support thread but I still can't get it to work for me.

by hubs | 05.01.03 05:33 PM

You know, I don't really think that it worked. Very bizarre. I wish I knew the answer. =(

by girlie | 05.01.03 05:38 PM

Observation - didn't do proper testing to see if this was actually relative, but...

The misbehavior seemed to die down after I tracked a javascript error message that came up with the popup comment window - the script was getting chopped at an inopportune place by the wrap effect in the MT Templates page window. I adjusted the spacing, and the error ceased - and the person I was doing the site for thanked me for fixing the remember me misbehavior. It has been a few weeks since I was working on it, and due to chronic ADD, I didn't get back to it, nor do I recall exactly where the break was falling - but it was in the middle of the commands to set the remember me cookies...

Not a fix, but hopefully a lead someone can capitalize on...

by Wind Rider | 06.15.03 09:25 PM

Testing a theory...

by Jay Allen | 07.28.03 02:17 PM

Seems to be working fine, no??

by Jay Allen | 07.28.03 02:21 PM

So - what's the theory? =)

Did you browse to entries in other archive locations to see if it remembered you there?

by girlie | 07.28.03 06:03 PM

The theory was that your HOST variable was making the script work ONLY on www.thegirliematters.com. for some reason, beyond my comprehension, it ALSO works on thegirliematters.com although it should not.

FWIW, I set my HOST variable to jayallen.org, although in another time, it was .jayallen.org (with the .). That should cover all subdomains.

I dunno, maybe I am not having problems with it because Safari seamlessly uses cookies between domains (although I think that would be a security hole)...

Where else should I look on the site to see if it remembers me? Your cookie is set at the root of your domain...

If you are having a problem (and *I* dont see it), I bet you it is because of your HOST var...

by Jay Allen | 07.28.03 06:15 PM

Go to this entry, for example.

When I first noticed the problem (as described in the entry), it was setting a cookie for the archive folders individually, rather than just the host. So I'd go from one entry to the next, never getting a consistent "remember me".

Now, when I check the cookie, it's set for www.thegirliematters.com - so maybe Adam's suggestion worked??

by girlie | 07.28.03 06:25 PM

I am remembered (awww), on that entry...

Yeah, Adam's suggestion is right on the money. Unless you have a namespace collision problem with cookies (like cookies from different parts of your site setting cookies by the same name and squashing each other) you should almost always set the cookie path to /.

One thing, by the way. I am sketical about the forgetMe function. First of all, if you set the cookie path to / it must be destroyed with / as the path. Your script has no path set (hence relative).

More importantly though, is that while the onchange event on the Remember personal info radio buttons DOES wipe out the fields, it actually does nothing to destroy the cookie giving someone the false security that their information was wiped out when it fact it was not.

In order for the cookie to be wiped out, one would actually have to submit a blank form...

Anyhow, yeah, I think the original problem is fixed, though...

by Jay Allen | 07.28.03 06:36 PM

So, are you saying I should put the / in the forgetMe function as well??

And if the cookie isn't really deleted, what stops the page from reading the cookie again on a later visit?

by girlie | 07.28.03 06:45 PM

Yes and I have no earthly idea... I have been playing with it... Remember the old versions used to have a forgetme button that you pushed and it submitted the form (blank), which did nothing but delete your cookie.

Now I have no idea how this is supposed to work...

by Jay Allen | 07.28.03 06:53 PM

The old and new forgetMe functions are identical - the only difference seems to be whether the onClick is called when the button is pushed vs. a radio button being checked:

Old:

<input type="button" onclick="forgetMe(this.form)" value="FORGET PERSONAL INFORMATION" />

New:

<input type="radio" id="forget" name="bakecookie" onclick="forgetMe(this.form)" value="Forget Info" style="margin-left: 15px;" />

by girlie | 07.28.03 07:06 PM

Posting this link here for reference:

Remember Me, Movable Type

by girlie | 08.13.03 07:46 PM

HTML drives me crazy

by barracuda | 11.30.03 04:57 PM

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

TrackBack: 4
(URL: http://www.thegirliematters.com/sf/mt-track.cgi/137)

» curing MT's senior moments
Excerpt: [the girlie matters] tips, tricks, and things to do to my site: remember me misbehavior I found this information while
Weblog: quotidian
Tracked: 03.15.03 06:18 PM

» Remember me
Excerpt: No, I don't remember you. Or at least that's what the cookies are saying. I can't fricken fix the stupid remember me script. I have tried copying and pasting the original default from the default templates at MT. I have tried rewriting portions of it. ...
Weblog: poeticgeek
Tracked: 08.08.03 10:07 AM

» Site maintenance update
Excerpt: This week I have been fixing all of the little annoyances I have recently found on this site. ">Rebuilding individual archives when pinged was added. This is a very handy piece of code that should be used by anyone that is doing inline TrackBack. I no ...
Weblog: Technically Speaking
Tracked: 10.09.03 11:10 AM

» comenta kas entradas
Excerpt: Por alguna razón que no me quedó muy clara, en ocasiones no se recordaban los datos de quien dejara comentarios (si le decías que te recordara, por supuesto). Así que gracias a un artículo de The Girlie Matters pude h...
Weblog: ::ratos de ocio::
Tracked: 02.11.04 10:28 AM