re-named cookie & broke login

re-named cookie & broke login

by John Gone -
Number of replies: 18
This could've been kinda cool, maybe even really cool if anybody visiting my Moodle ever checked the cookie they received. So, I gave the cookie a cool new name and, CRACK, I heard the site break. I didn't really hear it break but it's definitely broken. Now I can't login to put things right. Is there a way to fix this?
Thanking you in advance,

John "I mod, therefore, I am" Captain
Average of ratings: -
In reply to John Gone

Re: re-named cookie & broke login

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
How did you change it?  In any case, closing the browser then going back in should work.  Make sure the "new" cookie isn't being blocked.
In reply to Martin Dougiamas

Re: re-named cookie & broke login

by John Gone -
I changed it in the variables interface where it allows you to change it to avoid conflicts between co-existing Moodles.
The odd part is that these Moodle cookies expire at the end of the session so a new session should re-generate and in you go. No such luck. I haven't made any other changes, honest, haven't touched anything but the cookie name.
I can login here but not there. I definitely broke something when I changed the cookie name. As soon as I clinked a link in my site I was returned to the login page. Unable to login since.
It seemed like such a harmless little adventure...

Thanks,
John
In reply to John Gone

Re: re-named cookie & broke login

by Patrik Nilsson -

Sop much for the cool stuff.. eh..hehe

Have you tried to clean you chache and any cookies just so there isn't one still there messing with your system some way, so you get a fresh start on the cookies..

In reply to Patrik Nilsson

Re: re-named cookie & broke login

by John Gone -
"So much for the cool stuff.. eh..hehe"
...never, I'll never give up...
"I Moodle, therefore, I'm cool"
"Don't trust anyone over 30... uh, I mean 60"
"I mod, therefore, I am"

Anyway, ok, so, yep, I've re-booted even. I've even tried to login using 3 different computers. The new "cool" cookies are being accepted. This isn't a Moodle problem, it's an admin problem.

Thanks Gentlemen,

John
In reply to John Gone

Re: re-named cookie & broke login

by John Gone -
Is there something I can change in the database? My guess is yes because I've just created a new Moodle but with different table prefix and login, and everything else, works fine.

Thanks
John
In reply to John Gone

Re: re-named cookie & broke login

by John Gone -
This is a screenshot of the textbox I used to change the cookie name.
Also, I can use the same config with a different table prefix. Login and everything else works fine.
I changed the prefix, in my config.php file, uploaded to my existing broken Moodle, to make the site operational. I login no problem. I logout no problem. I login and logout at will.

I changed the name of the cookie for the new site and this had no effect on the site operation. I login no problem. I logout no problem. I login and logout at will.

I now have a database containing tables with different prefixes. I can change the prefix in my config.php file and upload it to the server and the new set of tables allows normal operation. I change the config.php file to use the old tables and I can't login.

The exact same files are used for both sessions. The only difference being the table prefix in my config.php file. This makes me think that I may be able to change something in the tables that were being used when I broke my site. Can anybody offer suggestions or best guess or even totally ridiculous experiment that may help me get my Moodle back in business? Everything's there. I just can't login, not even as a guest.
Thanks,
John
Attachment sessioncookie.jpg
In reply to John Gone

Re: re-named cookie & broke login

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Oh, I thought you'd fixed this earlier.  Just delete the "sessioncookie" entry from the "config" table.
In reply to Martin Dougiamas

Re: re-named cookie & broke login

by John Gone -
Ahhhh, (relieved sigh) that's better. big grin

Thanks Martin

PS: One difference I did notice between the two sites was this. I use a javascript to obfuscate an e-mail address and it wouldn't work with the site using the new tables?

PS
: It's actually kinda cool running two Moodles at the same time. I used the temporary site to display a news item saying we were down for maintenance. Because the site looked identical it looked plausible.
In reply to John Gone

Re: re-named cookie & broke login

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Now I'm really curious as to what this "cool" cookie name was (so we can prevent people doing it in future!)  smile
In reply to Martin Dougiamas

Re: re-named cookie & broke login

by Mike Patton -

Do you mean to delete the session cookie from the /admin/config.php

or from the config entry in the database itself ....

because I do not have a session cookie in the DB itself and the /admin/config.php doesn't do anything ....

HELP I BROKE MY MOODLE ! smile

In reply to Mike Patton

Re: re-named cookie & broke login

by Mike Patton -
In reply to Mike Patton

Re: re-named cookie & broke login

by Herbert Keijers -
Mike,
I notice your table shows only 30 ID's.
There is a button to show the next 30 ID's . Are your shure it isn't listed there ?
In reply to Herbert Keijers

Re: re-named cookie & broke login

by Mike Patton -

I definatly appreciate your help Herbert, but I have already dropped my database and started fresh ... I have a new class starting tommorow morning, and If I was gonna have to drop the DB then I had to do it then so I could start rebuilding ...

Thank you for your concern ..problem solved ...the hard way !

smile

In reply to Herbert Keijers

Re: re-named cookie & broke login

by Scot Gardner -

DOH!

I had this same problem, when I changed the cookie name, and yes I could not find the setting in the db, and sure enough I was limiting my list to 50 entries.  changed my cookie back to what it was before and I can now log in.

Scot

In reply to Scot Gardner

Re: re-named cookie & broke login

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Scot - what was the "bad" cookie name that didn't work?
In reply to Martin Dougiamas

Re: re-named cookie & broke login

by Scot Gardner -
Martin,  before the upgrade it was blank, after the upgrade I set it to
myhbc.info   

Scot



In reply to Scot Gardner

Re: re-named cookie & broke login

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Thanks.  I've checked in a fix that will now strip all characters except a-z and A-Z.