lunken Posted March 8, 2011 Share Posted March 8, 2011 Hi all!I have 2 shops on different domains, 1 original and 1 copy.The problem is that admin get gets screw uped cause both shops have the same cookiename.I guess thats the problem anyway.As it is now I have to admin one shop in Chrome and one in IE.Is it possible to change the cookienamne like cookie_shopename1_com and cookie_shopname2_com?Thanks in advance!/Thomas Link to comment Share on other sites More sharing options...
Radu Posted March 8, 2011 Share Posted March 8, 2011 What exactly is the issue you have? what are you trying to do? Link to comment Share on other sites More sharing options...
lunken Posted March 8, 2011 Author Share Posted March 8, 2011 For one thing, it mess up login for adminpanel if I have different login for the 2 shops. Link to comment Share on other sites More sharing options...
Radu Posted March 8, 2011 Share Posted March 8, 2011 do you have the same database for both shops? Link to comment Share on other sites More sharing options...
lunken Posted March 8, 2011 Author Share Posted March 8, 2011 No.I (I and I, it was some compentent guys who did it) made one shop with a nice theme then I just copied the whole thing, incl. database but re-named it.But I guess cause it the same installation from the beginning, it has the same cookienames?http://www.takbox.se/butik - copyhttp://www.verktygssats.se - original Link to comment Share on other sites More sharing options...
Radu Posted March 8, 2011 Share Posted March 8, 2011 you shouldn't have any problems, the database are different, the domains are different, even with same cookie names there is no issue.if you get an error please let me know how I can replicate it Link to comment Share on other sites More sharing options...
evolution.x Posted February 11, 2013 Share Posted February 11, 2013 (edited) Sorry to dig up an old thread but I have a similar problem. I had 1 main website (www.mysite.com) running 1.4.9.0. I needed to duplicate the site and run it independently from a sub domain (www.sub.mysite.com) I changed all of the variables in settings.inc.php, yes i changed the define COOKIE_KEY & COOKIE_IV in the duplicate. I have both sites running fine almost 90% of the time but here is my problem: If a customer visits my main site (www.mysite.com) it places a cookie on the computer with a unique "Cookie Name", then if the same customer visits my sub domain (www.sub.mysite.com) and tries to log in, they can't?? I have looked at the cookies the sites place on my computer and they both have the same "Cookie Name" this is the only thing I think is conflicting. When they try to log in it just clears the login boxes and refreshes the page. If I remove the cookie which (www.mysite.com) placed on my computer and try to login (www.sub.mysite.com) again it works fine? Like I said I have different settings in settings.inc.php but even if I change these again I always get 2 cookies with the same name?? How do I change the generated cookie name of (www.sub.mysite.com)?? I have looked in "classes/cookie.php" and found "$this->_name = md5($name);" but i assume this is using the COOKIE_KEY from setting.inc.php for the md5?? I have changed COOKIE_KEY setting several times but the cookie name never changes?? Edited February 11, 2013 by evolution.x (see edit history) Link to comment Share on other sites More sharing options...
Radu Posted February 11, 2013 Share Posted February 11, 2013 if "yes i changed the define COOKIE_KEY & COOKIE_IV in the duplicate" then the login won't work anymore because the encryption is different. Leave them alone and it should work fine or at least as far as I can see now Link to comment Share on other sites More sharing options...
El Patron Posted February 11, 2013 Share Posted February 11, 2013 check the built in support for sharing cookies between domain and subdomain. I don't use it but PS does support the sharing of cookies this way. back office-->tools-->subdomains Link to comment Share on other sites More sharing options...
evolution.x Posted February 12, 2013 Share Posted February 12, 2013 (edited) if "yes i changed the define COOKIE_KEY & COOKIE_IV in the duplicate" then the login won't work anymore because the encryption is different. Leave them alone and it should work fine or at least as far as I can see now I changed the COOKIE_KEY & COOKIE_IV yes but i also reencryped all of the passwords on md5.fr with the new COOKIE_KEY Edited February 12, 2013 by evolution.x (see edit history) Link to comment Share on other sites More sharing options...
evolution.x Posted February 12, 2013 Share Posted February 12, 2013 check the built in support for sharing cookies between domain and subdomain. I don't use it but PS does support the sharing of cookies this way. back office-->tools-->subdomains It's not that i want to share the cookie i need them to be 2 independent websites, it is basically a retail and trade site. Link to comment Share on other sites More sharing options...
evolution.x Posted February 12, 2013 Share Posted February 12, 2013 (edited) I have solved the problem, i compared the cookie.php from 3 PS versions, 1.3.2.3, 1.4.9.0 & 1.5.3.1. I noticed that on around line 66, this code is different: In 1.4.9.0 is it: $this->_name = md5($name); In 1.3.2.3 it is: $this->_name = md5($name._COOKIE_KEY_); And in 1.5.3.1 it is: $this->_name = md5(_PS_VERSION_.$name); The 2 sites i am running are 1.4.9.0 and if you look at the code it only encrypts with $name, if both shops are called the same thing this will give the same cookie name, so i added this code to 1.4.9.0: $this->_name = md5($name._COOKIE_KEY_); Which now encrypts the shop name against the COOKIE_KEY, and the cookie keys are different in each site resulting in different cookie names. Not sure why PS decided to remove this from 1.4.9.0?? Edited February 12, 2013 by evolution.x (see edit history) 1 Link to comment Share on other sites More sharing options...
waldemar [pl] Posted March 19, 2013 Share Posted March 19, 2013 evolution.x: Thank You. I had the same problem as you. You helped me to solve it. Link to comment Share on other sites More sharing options...
evolution.x Posted March 25, 2013 Share Posted March 25, 2013 ' timestamp='1363725137' post='1149106']evolution.x: Thank You. I had the same problem as you. You helped me to solve it. Your welcome, glad it helped you. It gave me plenty of hours of headaches 1 Link to comment Share on other sites More sharing options...
Pete78 Posted April 30, 2014 Share Posted April 30, 2014 Just want to say thank you as well: Had this problem: 2 different shops with different database/files on sub.domain.org and www.domain.org (same physical server) After logging in at sub.domain.org I could see account details at www.domain.org of a different customer. Actually the data from the customer with the same id but of the wrong shop... not good at all. Shop was 1.5.4.1 This solved the problem. Don't know if it happened because of copy of shops, but this helps: $this->_name = md5($name._COOKIE_KEY_); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now