Problem cookie setting

Discussion regarding Joomla! 3.x Performance issues.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
sandroe
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Jul 14, 2008 11:00 am

Problem cookie setting

Post by sandroe » Thu Mar 05, 2015 4:25 pm

I wanted to set, in the global configuration, cookies I put the following values
Cookie Domain : .mydomain.net
Cookie Path: / tmp
everything works but the back end is no longer accessible. Do I login but the rest goes to the login page.
to access I had to edit the config file by excluding all entries extras inside after the setting of cookies.
public $memcached_persist = '1';
public $memcached_compress = '0';
public $memcached_server_host = 'localhost';
public $memcached_server_port = '11211';
public $redis_persist = '1';
public $redis_server_host = 'localhost';
public $redis_server_port = '6379';
public $redis_server_auth = '';
public $redis_server_db = '0';
public $proxy_enable = '0';
public $proxy_host = '';
public $proxy_port = '';
public $proxy_user = '';
public $proxy_pass = '';
public $mailonline = '1';
public $massmailoff = '0';
public $session_memcache_server_host = 'localhost';
public $session_memcache_server_port = '11211';
public $session_memcached_server_host = 'localhost';
public $session_memcached_server_port = '11211';
public $frontediting = '1';
public $asset_id = '1';

where am I wrong?
how should I set these parameters correctly?

Regard

User avatar
NathanHawks
Joomla! Ace
Joomla! Ace
Posts: 1900
Joined: Wed Oct 02, 2013 6:17 pm
Location: Washington state, U.S.
Contact:

Re: Problem cookie setting

Post by NathanHawks » Thu Mar 05, 2015 6:05 pm

Cookie Path should not be tmp under most circumstances. That option does not control where things go on the client-side. Rather it determines what path on the server-side, this cookie applies to.

I don't understand what you mean by:
to access I had to edit the config file by excluding all entries extras inside after the setting of cookies.
However fix the cookie-path first because it could easily be the cause of your admin login problem.
Save time - hire me for your Joomla to-do list! http://nathanhawks.us/joomla

sandroe
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Jul 14, 2008 11:00 am

Re: Problem cookie setting

Post by sandroe » Fri Mar 06, 2015 1:26 pm

hi,
I thank you for the answer, could you tell me the right values to be entered in the fields?
regarding my access problems, due to incorrect configuration were resolved by downloading the config file via ftp, delete the following lines and disable the configuration of cookies. performed these operations I could again access the back end.
I would like to understand why the right configuration for these values.

many thanks

sorry my bad English

User avatar
NathanHawks
Joomla! Ace
Joomla! Ace
Posts: 1900
Joined: Wed Oct 02, 2013 6:17 pm
Location: Washington state, U.S.
Contact:

Re: Problem cookie setting

Post by NathanHawks » Fri Mar 06, 2015 3:21 pm

I can't help unless I know what you are trying to do, and why. These steps are not normally necessary.
Save time - hire me for your Joomla to-do list! http://nathanhawks.us/joomla

sandroe
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Jul 14, 2008 11:00 am

Re: Problem cookie setting

Post by sandroe » Fri Mar 06, 2015 5:09 pm

Hi,
I did a website speed test with the site http://tools.pingdom.com/ , and I get to the "Page Speed Performance" a low value (65) relative to "Serve static content from a cookieless domain" with the message "serves the Following static resources from a domain That does not set cookies: "followed by a list of files. I tried to set the values, in the "Global Configuration" as follows:
Cookie Domain: .tribefitness.net
Cookie Path: / tmp
in this way, doing the test again, I get a value of 95, but I can not access the back end.
I think then that he had done something wrong but I do not know where. :(

User avatar
NathanHawks
Joomla! Ace
Joomla! Ace
Posts: 1900
Joined: Wed Oct 02, 2013 6:17 pm
Location: Washington state, U.S.
Contact:

Re: Problem cookie setting

Post by NathanHawks » Mon Mar 09, 2015 3:35 pm

Okay, undo what you did with regard to cookie changes.

A "cookieless domain" is a domain which does not set cookies at all. Setting a broken cookie, won't help.

Your domain uses cookies, and it must use cookies or Joomla can't work. Therefore your domain will never be a cookieless domain.

If you have a 65 then this issue is probably not your only issue and might not be your biggest issue.

However, on the other hand -- and perhaps fully negating that 65 score along with its underlying logic -- I have never heard of Pingdom. Use YSlow instead, it is an excellent open source tool made by people who are not trying to just put a confusing pile of BS in front of your face to make you throw up your hands in frustration and buy their services ;) Not that I'm saying Pingdom is like that - only that I trust YSlow and think its advice may be better for you, as I'll explain below.

http://yslow.org/

It's a browser plugin. It breaks its advice down similar to how Google Pagespeed Insights does, but its advice is applicable to the entrepreneurial world - whereas I think other tools like Pagespeed Insights are targeted only at businesses who can afford to "just buy a CDN" (which is like the internet equivalent of buying an island).

However, entirely separate from that and on the subject of speed optimization generally: there still might be reason to take the advice to handle these static assets somehow. Not usually - static assets are normally served by your own local website - it's not advice I would follow blindly - but if you have a good reason to have huge files which will be frequently requested, then yes, you should remove the risk that these large downloads will crowd out normal web traffic. However you might instead simply be abusing your users' data connections with objectively bad web design, e.g. a page made of un-optimized images.

Whatever else you do, undo the changes you made to the way Joomla deals with cookies.
Save time - hire me for your Joomla to-do list! http://nathanhawks.us/joomla

User avatar
NathanHawks
Joomla! Ace
Joomla! Ace
Posts: 1900
Joined: Wed Oct 02, 2013 6:17 pm
Location: Washington state, U.S.
Contact:

Re: Problem cookie setting

Post by NathanHawks » Mon Mar 09, 2015 3:41 pm

PS: In your original post, it seems like you might be saying, that you deleted everything from the config file and replaced it with basic text describing your desired cookie state. If that is the case, you need to restore your configuration.php file to its state the last time your site worked. That file should only be hand-edited by an expert -- otherwise your site will break (as, in either case, you've now seen).
Save time - hire me for your Joomla to-do list! http://nathanhawks.us/joomla

studiocardo
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Wed Sep 17, 2014 4:58 pm

Re: Problem cookie setting

Post by studiocardo » Mon Mar 09, 2015 11:00 pm

Hi Nathan

Could you elaborate what you mean by:

"Your domain uses cookies, and it must use cookies or Joomla can't work. Therefore your domain will never be a cookieless domain."

I understand Joomla needs cookies to operate. But just to be clear, you are not saying that one can not serve static content on a separate sub-domain as an attempt to incrase YSlow/Page Speed scores. Could you confirm? The tech support staff from my hosting provider is quoting your statement above and claiming that a separate cookieless domain is not doable for Joomla.

If it is indeed doable, is it possible for you to provide some guidance on how to configure Joomla (either via global configuration or configuration.php) to tell it to serve static content (specifically template materials and js files) on static.mydomain.com?

There are two configuration options in Global Configuration pertaining to cookies, but I have a hard time understanding the instructions found on

https://docs.joomla.org/J3.x:Global_configuration

as I seem to be coming from the opposite direction of what the documentation describes... The documentation seems to focus on .mydomain.com vs. www.mydomain.com... I think that's quite confusing, since I don't think most site are set up like... Aren't most sites using .htaccess to redirect mydomain.com to www.mydomain.com or vice versa?

On my site, currently both Cookie Domain and Cookie Path are blank in Global Config. And that seems to mean everything served by Joomla will be accompanied by cookies. But if I have my static.mydomain.com for js/css/template files, how do I specify that to Joomla?

There are many postings on how to do this on Wordpress but none on Joomla... Since both YSlow and Page Speed identified this as a key fix for my sites, it's a bit frustrating not being able to implement the fix.

Thank you very much for your advice.

SH

ps. right now my Page Speed is 93 and YSlow is 82, but more attainable improvements can be made. And the load time is still too long...

sandroe
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Jul 14, 2008 11:00 am

Re: Problem cookie setting

Post by sandroe » Tue Mar 10, 2015 12:29 pm

hi,
to better understand enclose two images,
see how the overall score is 95.
now setting the values
Cookie Domain: .tribefitness.net
Cookie Path: / tmp

I get an overall score of 99 but as mentioned not I access the administrative part of the site.
my question is only how to set those parameters and still have access to the back end

Thank you very much for your cooperation
You do not have the required permissions to view the files attached to this post.

User avatar
NathanHawks
Joomla! Ace
Joomla! Ace
Posts: 1900
Joined: Wed Oct 02, 2013 6:17 pm
Location: Washington state, U.S.
Contact:

Re: Problem cookie setting

Post by NathanHawks » Wed Mar 11, 2015 2:00 pm

@studiocardo I am going by the definitions of individual words here.

Cookieless -- does not serve cookies
Domain -- something.xyz

Therefore a domain with Joomla on it cannot be a cookieless domain.

It's like a cloudless sky. You are asking if that patch of blue over there disqualifies the word "cloudless." Going just by the definitions of individual words, that is the opposite if how it works. A sky with one blue patch is not a "cloudless sky" and a domain which serves lots of cookies normally is not a "cookieless domain."

Besides all of which, it could be, nowadays, that hosts might tend to configure PHP to autostart sessions for all visitors, in which case you would get a cookie no matter what content you hit. But that's just a random additional thought.

@sandroe - So you are saying you have reversed all of the changes you have made to files -- changed everything back to the way it was before you touched it -- and are still having trouble?

As for your speed test result, it is impossible to reach 100% on those testers. If you are at 99% you are winning the internet.
Save time - hire me for your Joomla to-do list! http://nathanhawks.us/joomla

DeLLiAnO
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed May 25, 2011 10:29 pm

Re: Problem cookie setting

Post by DeLLiAnO » Thu Dec 22, 2016 4:30 pm

The trick to make the cookie path and domain to work is plain and simple.

Cookie path: .yoursite.com
Cookie path: /

Save it.

Go to your browsers history and delete the history.
Go back to your administrator side and login

That did the trick for me

grtz

User avatar
darb
Joomla! Ace
Joomla! Ace
Posts: 1921
Joined: Thu Jul 06, 2006 12:57 pm
Location: Stockholm Sweden
Contact:

Re: Problem cookie setting

Post by darb » Sun Jan 22, 2017 10:46 am

NathanHawks wrote:@studiocardo I am going by the definitions of individual words here.

Cookieless -- does not serve cookies
Domain -- something.xyz

Therefore a domain with Joomla on it cannot be a cookieless domain.

It's like a cloudless sky. You are asking if that patch of blue over there disqualifies the word "cloudless." Going just by the definitions of individual words, that is the opposite if how it works. A sky with one blue patch is not a "cloudless sky" and a domain which serves lots of cookies normally is not a "cookieless domain."

Besides all of which, it could be, nowadays, that hosts might tend to configure PHP to autostart sessions for all visitors, in which case you would get a cookie no matter what content you hit. But that's just a random additional thought.

@sandroe - So you are saying you have reversed all of the changes you have made to files -- changed everything back to the way it was before you touched it -- and are still having trouble?

As for your speed test result, it is impossible to reach 100% on those testers. If you are at 99% you are winning the internet.

Hi for people that want to use the "Serve static content from a cookieless domain" it's important to understand how to set up that for a Joomla site.

Can you address the question and explain the real use of why Joomla have Cookie domain: .yoursite.com and a Cookie path: /cookie path?

If people don't understand how use and how it works with their config file, htaccess and Cname for using it with your own sub domain for serving static content from a cookieless domain then why Joomla have these settings?

Everybody understands what a cookie and a domain is and "a domain with Joomla on it cannot be a cookieless domain".

Pls explain for people how it works bcs the Joomla docs doesn't show examples and explain how to do it.

Rgds

DeLLiAnO
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed May 25, 2011 10:29 pm

Re: Problem cookie setting

Post by DeLLiAnO » Sun Jan 22, 2017 12:42 pm

Good point Darb


Locked

Return to “Performance - Joomla! 3.x”