logo

eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 1528
Possible solution to cookies

If you have multiple installations of eoCMS on either subdomains or different folders, the cookies are all set the same name and you arent logged in due to that. Current solution is change the name in the config.php file. Paul suggested maybe using the site name in the cookie name however that meant the define would have to be created after the $settings which shouldn't be a problem.
However most browsers disallow certain characters in cookie names.
My solution is to md5() the site name, split the hash down to say 6 chars, and use that as the cookie name, what you think?

Please do not PM me requesting support or anything, use the forums, thats what they are here for
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 242
banancanardbanancanard@live.com
Re: Possible solution to cookies

Well, I think it is a good idea.  I would leave the whole md5 though as and group of characters could be reproduced but the whole hash can not unless it is the same site name.  Also, instead of doing the site name (which any site could have the same site name) do the site url as that will be unique for each site. 
Does this make sense at all?

"Control yourself. Take only what you need from it"
http://mrrsm.com
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 1528
Re: Possible solution to cookies

It does a little bit Tongue So what your saying is md5 the site url and keep the hash as a whole instead of cutting it down? Would be a pretty big cookie name if it wasnt cut down, 32 characters long...
Last Edit: 26th August, 2009, 02:29:22 AM by confuser

Please do not PM me requesting support or anything, use the forums, thats what they are here for
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 242
banancanardbanancanard@live.com
Re: Possible solution to cookies

If you want to get a 20 char string you can use sha1 with the binary flag as true.  Other then that who cares how long it is?  On top of that, you could just make it some random string of X characters.  The likely hood of it being the same as another one is small, possible but small.

"Control yourself. Take only what you need from it"
http://mrrsm.com
Member
Member
Offline Offline
Posts: 144
Re: Possible solution to cookies

Ive also noticed that if you have eoChat running with eoCMS (or any other app) both apps $_SESSION globals will mash together and stop eachother functioning correctly
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 242
banancanardbanancanard@live.com
Re: Possible solution to cookies

If you are using the same domain the session variables will clash.  You can get around this within cretin apps by making the session vars unique.  For example,  eocms session vars are all $_SESSION['eocms_XXXX'], eochat could be $_SESSION['eochat_XXXX'] etc.  That should help with conflicting sessions at least a little bit.

"Control yourself. Take only what you need from it"
http://mrrsm.com
eoCMS Developer
eoCMS Developer
Offline Offline
avatar
Posts: 1528
Re: Possible solution to cookies

eoCMS no longer uses sessions to keep you logged in, only uses it for Admin update messages and for CSRF protection

Please do not PM me requesting support or anything, use the forums, thats what they are here for

Jump to:


0.07 seconds Queries: 13