News:

AbanteCart v1.4.2 is released.

Main Menu
support

How to set cookie domain

Started by Ollie, November 08, 2016, 08:13:56 AM

Previous topic - Next topic

Ollie

For some reason, credit card data is not passing to my language subdomains (which are hosted by a company other than my web host). The company explained that I need to set cookie domain so the data transfers from mydomain.com to mysubdomain.com. My coder says I cannot simply change the url to a relative one because it is generated with built-in function: https://github.com/abantecart/abantecart-src/blob/master/public_html/extensions/default_authorizenet_aim/storefront/view/default/template/responses/default_authorizenet_aim.tpl#L88 According to him, this function generates the URL based on server configuration: https://github.com/abantecart/abantecart-src/blob/master/public_html/core/engine/html.php#L179

I posted a question the other day in this forum and one of the core developers suggested replacing "null" on line 364 with my domain name. I tried this, but it didn't work: https://github.com/abantecart/abantecart-src/blob/master/public_html/core/engine/language.php#L364

How can I set cookie domain in AbanteCart? Any help will be greatly appreciated.
Assistive technologies for people with special needs:
https://assistech.com/store/

abolabo

Why did you deleted your original topic?
i already suggested solution before.

You should to set domain that cover all your subdomains into your cookies.
For details please read about function "setcookie" and it's "domain" parameter http://php.net/manual/en/function.setcookie.php

You should to replace "null" in parameters with your main domain in this function call inside your AbanteCart,
for ex. in file core/engine/language.php
setcookie('language',
$lang_code,
time() + 60 * 60 * 24 * 30,
dirname($request->server['PHP_SELF']),
null,
(defined('HTTPS') && HTTPS)
);

and other places.

Then DELETE ALL COOKIES for YOUR DOMAIN and subdomains in browser and check.


"No one is useless in this world who lightens the burdens of another."
― Charles Dickens

Ollie

#2
Quote from: abolabo on November 08, 2016, 09:52:56 AM
Why did you deleted your original topic?
i already suggested solution before.

As I explained in this post, the solution you suggested earlier did not work for me. I waited for a solution for several days, nobody responded; that's why I deleted the original post. Are you proposing the same solution or is this something new? I'm not clear what you mean by "other places". Can you be more specific? Thank you.
Assistive technologies for people with special needs:
https://assistech.com/store/

abolabo

"No one is useless in this world who lightens the burdens of another."
― Charles Dickens

Forum Rules Code of conduct
AbanteCart.com 2010 -