Forums / General Questions / change cookie domain name

change cookie domain name

Locked

Views: 4,312

Results 1 to 20 of 21
This thread is locked. New replies are disabled.
27 Nov 2010, 6:05 PM
#1
Join Date:
Nov 2007
Location:
oregon
Posts:
70
Plugin Contributions:
0

change cookie domain name

in the sessions settings in admin you change from true to false to change from www,yourdomain.com to yourdomain.com, how can we set the cookie name to a custom value like .yourdomain.com

27 Nov 2010, 7:18 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: change cookie domain name

Please elaborate your exact issue as .yourdomain.com is not a valid/acceptable form

Zen-Venom Get Bitten

27 Nov 2010, 7:25 PM
#3
Join Date:
Nov 2007
Location:
oregon
Posts:
70
Plugin Contributions:
0

Re: change cookie domain name

kobra:

Please elaborate your exact issue as .yourdomain.com is not a valid/acceptable form

I am doing a custom install for a client and they are bridgeing zencart to a cms threw a 3rd party application and the cookie in zen needs to be set to .yourdomain.com left out specific names since none of the projects seem to like eachother for some reason there all open source.

27 Nov 2010, 7:29 PM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: change cookie domain name

have you tried the "Add period prefix to cookie domain" setting?

Zen-Venom Get Bitten

27 Nov 2010, 7:33 PM
#5
Join Date:
Nov 2007
Location:
oregon
Posts:
70
Plugin Contributions:
0

Re: change cookie domain name

kobra:

have you tried the "Add period prefix to cookie domain" setting?

where is that setting I have searched the form and internet for 2 days looking for such a setting

27 Nov 2010, 7:37 PM
#6
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: change cookie domain name

Admin - Configuration - Sessions

27 Nov 2010, 7:37 PM
#7
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: change cookie domain name

Zen-Venom Get Bitten

27 Nov 2010, 7:44 PM
#8
Join Date:
Nov 2007
Location:
oregon
Posts:
70
Plugin Contributions:
0

Re: change cookie domain name

stevesh:

Admin - Configuration - Sessions

you cannot change the name there

27 Nov 2010, 8:02 PM
#9
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: change cookie domain name

You still need to be very specific about what you are attempting

As it sounds like tou want the have ZenCart installed at dimain "A" but set a cookie to some other domian???
For what purpose? What would doing this accomplish except for an incorrect pointing?

Zen-Venom Get Bitten

27 Nov 2010, 8:05 PM
#10
Join Date:
Nov 2007
Location:
oregon
Posts:
70
Plugin Contributions:
0

Re: change cookie domain name

kobra:

You still need to be very specific about what you are attempting

As it sounds like tou want the have ZenCart installed at dimain "A" but set a cookie to some other domian???
For what purpose? What would doing this accomplish except for an incorrect pointing?

i just want to change the cookie set from yourdomain.com to .yourdomain.com notice the period in front.

27 Nov 2010, 8:10 PM
#11
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: change cookie domain name

i just want to change the cookie set from yourdomain.com to .yourdomain.com notice the period in front.
But then you state
you cannot change the name there

I suggested "Add period prefix to cookie domain" setting?
That appears to be what you want -
Depending on which of your posts I choose to believe

Zen-Venom Get Bitten

27 Nov 2010, 8:23 PM
#12
Join Date:
Nov 2007
Location:
oregon
Posts:
70
Plugin Contributions:
0

Re: change cookie domain name

kobra:

But then you state

I suggested "Add period prefix to cookie domain" setting?
That appears to be what you want -
Depending on which of your posts I choose to believe

yes that is what i want but can find no setting for that have searched for that setting in docs and the internet and form. it is not in the admin/configure sessions settings at least not in zen version 1.3.9f

27 Nov 2010, 8:47 PM
#13
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: change cookie domain name

it is not in the admin/configure sessions settings at least not in zen version 1.3.9f
I do not have "f" installed but upgrade to "h" is easy and it is there

Zen-Venom Get Bitten

27 Nov 2010, 8:51 PM
#14
Join Date:
Nov 2007
Location:
oregon
Posts:
70
Plugin Contributions:
0

Re: change cookie domain name

kobra:

I do not have "f" installed but upgrade to "h" is easy and it is there

ok thank you will upgrade now.

28 Nov 2010, 8:02 AM
#15
Join Date:
Nov 2007
Location:
oregon
Posts:
70
Plugin Contributions:
0

Re: change cookie domain name

kobra:

I do not have "f" installed but upgrade to "h" is easy and it is there

Yes the upgrade had the required field thank you.

Now when zencart is installed in a subdomain no matter if you set the cookie domain to true or false it looks like this .sub.domain if not in a subdomain you can change it with that setting to look like https://www.domain.com or domain.com is there a way to over ride this for sub domains to just show .domain.com

28 Nov 2010, 11:35 AM
#16
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: change cookie domain name

is there a way to over ride this for sub domains to just show .domain.com
Now it seems you are back to wanting it to point to where you do not have the cart installed????

What can be gained from this except a broken cart???

Elaborate not on what you want to override but exactly what it is you are attempting and why

Zen-Venom Get Bitten

28 Nov 2010, 8:02 PM
#17
Join Date:
Nov 2007
Location:
oregon
Posts:
70
Plugin Contributions:
0

Re: change cookie domain name

kobra:

Now it seems you are back to wanting it to point to where you do not have the cart installed????

What can be gained from this except a broken cart???

Elaborate not on what you want to override but exactly what it is you are attempting and why

I am attempying to override the way zen names it cookies. The reason for this is so all scripts on my domain write the cookie the same way so a user can login anywhere on site and be loged in to everything.

cookie name needs to be .domain.com this is easy to achive if set in a folder off of main domain but NOT if it is set in a subdomain. I have expermented with this over the last week.

I think this has something to do with the url in the config file but it doesn't make sence because if you list a url for site as www.domain the session setting still will strip the www so why won't it strip the subdomain infront of the domain?

What can be gained from this a single login for site users to beloged in across all areas of site like yahoo and google. This is the future of sites with more then one area ease of access for visitors.

28 Nov 2010, 8:29 PM
#18
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: change cookie domain name

The issue is most likely a session/security one

I will belay this to one of the ZenCart Dev's to validate

Zen-Venom Get Bitten

28 Nov 2010, 8:52 PM
#19
Join Date:
Nov 2007
Location:
oregon
Posts:
70
Plugin Contributions:
0

Re: change cookie domain name

kobra:

The issue is most likely a session/security one

I will belay this to one of the ZenCart Dev's to validate

After reading every post i could find on sessions and its setting I believe this is a bug in the scrippt it should remove the sub off of sub.domain.com am posting in the bugs form.

30 Nov 2010, 12:58 AM
#20
wilt avatar

wilt

Oji-san

Join Date:
Jun 2003
Location:
Newcastle UK
Posts:
1,912
Plugin Contributions:
3

Re: change cookie domain name

Hi,

No its not a bug !!!!!

There are a number of ways you can manipulate that actual domain that Zen Cart uses to store cookies.

Firstly in admin->configuration->sessions

see the Cookie Domain option. This can be set to FALSE to not use the fully qualified domain name.

If this does not help, you can also set an override option, such that you can define a custom cookie domain just for your site.

in includes/extra_configures create an override file, and in that set some defines as below

define('HTTP_COOKIE_DOMAIN', 'mydomain.com');
define('HTTPS_COOKIE_DOMAIN', 'mydomain.com');

You may also need to force the cookie into the root path of the domain as well, again there are settings in admin to help with this.

admin->configuration->sessions