MyBB Community Forums

Full Version: Changing Cookie Path Without Problems
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What's the best way to change the cookie path without ramifications?

At the moment, changing the cookie path means that people logged in will never be able to log out (and probably something else, too). Perhaps it's a bug but I'm not too interested in that aspect, just want to know if I should clear a table or two in the database to work around this.
Why do you need to change them?? Any way you change them may cause a problem until people clear their cookies, and that's all they'll have to do, clear their cookies. And why would you clear a table....??
Because I want to integrate the rest of my site with MyBB, and having /forum/ as the path doesn't make that all-too-easy.

Depending on the setup, clearing a table (or column) could automatically make the forum software null the cookies and log people out if it's cleared; which is what I'm after preferably.
Maybe you can run some SQL query to make all members log out.
Well yeah, but what one.
When a cookie is created, it's saved on the user's computer. You can't just run a SQL query and everyone's cookie path will be updated. People will first have to visit your forums, login again, and the path will be updated.
I have a feeling clearing the loginkey will do it...

UPDATE  `mybb_users` SET  `loginkey` =  ''

But wait for confirmation on that, I'm just throwing that out there. It works on my test forum, clearing it logs you out, but it may have some other implication I'm not aware of.
(2009-02-01, 12:47 AM)RenegadeFan Wrote: [ -> ]When a cookie is created, it's saved on the user's computer. You can't just run a SQL query and everyone's cookie path will be updated. People will first have to visit your forums, login again, and the path will be updated.

Er, yes you can. Say the loginkey thing works (and I have a suspicion it will, too), when a user visits the forum, the forum software picks up that the keys don't match and the user is automatically logged out (ie. nulling the cookie), then they have to log back in again and everything's fine.



I gave the loginkey thing a go and it didn't work. Er, at all. Which doesn't make a great deal of sense since it created new cookies and login keys upon login, but wouldn't login. meh.



Bump!
Truncate your sessions table. Then alter the cookie path. It shouldn't be a problem.