Support

Admin Tools

#12614 Disable sessions (cookie) for guests

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by on Wednesday, 18 July 2012 18:00 CDT

jjst135
Mandatory information about my setup:

Have I read the related troubleshooter articles above before posting (which pages?)? Yes
Have I searched the tickets before posting? Yes
Have I read the documentation before posting (which pages?)? Yes
Joomla! version: 2.5.4
PHP version: 5.3
MySQL version: (unknown)
Host: (optional, but it helps us help you)
Admin Tools version: 2.5.4

Description of my issue:

Hi. Would it be hard to include a setting in Admin Tools that disables all joomla session cookies in the frontend for guests? I found a hack (changes to joomla index.php and session.php) but a setting in Admin Tools would be nicer...

This has to do with the (stupod) EU cookie laws. If I want my website(s) to have no cookies at all, I need to get rid of the cookie Joomla sets as a session cookie.

Thanks!

With regards,
Jip Jonker

nicholas
Akeeba Staff
Manager
Hi Jip,

Unfortunately this is not possible for technical reasons. Joomla! creates a cookie and writes a database record in order to initiate a session. The session is prerequisite for the proper functionality of tokens. Tokens are a prerequisite for protecting forms against cross-site request forgery (CSRF) and brqute forcing. This protection is a prerequisite for having safe login forms. So, implementing that would be equivalent to dropping your pants and bending over to hackers. Not my idea of fun!

BTW, there is an offical opinion from Great Britain judicial authorities which interpretes the EU legislation quite differently than what we assumed. As long as you're informing your users that you are using cookies the responsibility for the acceptance of cookies lies with the user, not the site's owner. Hence our banner on the top of the page.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

jjst135
Ok, thanks Nicolas. Did not know that. Don't want to drop my pants ;-) This is also true for sites thant have no login or forms of any kind?

This Joomla session cookies is a 'necessary cookie' and no concent is needed for this session cookie?

I hope the rules will change here (NL) to the way GB does it now. We'll wait and see.

nicholas
Akeeba Staff
Manager
This is required for all forms. Besides, even if you don't have a login page it doesn't mean that Joomla! doesn't have one which can be accessed dirctly if you know the URL (yeap, that's the truth for all CMS out there). Disabling cookies, sessions and tokens would make our sites vulnerable to CSRF and brute forcing of passwords.

Regarding the EU law, it's the same across Europe. The wording is sufficiently vague to allow the interpretation I mentioned above. Otherwise the entire continent will be forced to switch to static sites, as any dynamic site will no longer be able to work in a safe manner.

FWIW I consider this EU law utter bollocks. The rationale behind it is beyond all logic. If they want to protect EU citizens they should do the same with cars. Before turning on your car there should be a pre-recorded message saying "Driving a car is potentially dangerous and can lead to serious injury or death. If you agree with this please honk twice". Or before you enter the bathtub there should be a large banner "Slipping in the bathtub is one of the most common reasons for deaths inside the house. If you would like to take the risk turn the tap to the right, otherwise stay filthy". The same should hold true for kitchens, refrigerators, food packaging, elevators, even glasses of water. Of course that would be absurd; people are not idiots, so why treat them like bloody morons? Which is exactly what they are doing with the cookie law. Stupid lawmakers. If things continue like that, everyone will move his business to the US in a matter of three years.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

jjst135
Hi Nicolas,

Thanks for our take on this.

Just to clarify: If someone wants to 'attack' a Joomla! website couldn't they just disable cookies themselves? As a user I can block cookies in my webbrowser, right?

Anyway, we'l see what happens with this law in the next few months...

nicholas
Akeeba Staff
Manager
That's the whole point. If you "disable" cookies what you're actually doing is this: even though the site sends you a cookie, you don't store it and don't pass it back to the site during the next request. As a result the site creates a brand new session on your next request. A brand new session uses a brand new token. But that's not the real functionality of the token. Here are two scenarios.

A. Without a token. The attacker writes a script which only submits a form and examines the site's response. Since no token is used, all form submissions go through. The attacker can run hundreds of attacks to the same site at the same time as he only needs a very low-bandwidth, low-latency POST request.

B. With a token. The attacker has to first GET a page which displays a login form and store the cookie. He has to parse the HTML and extract the token. The he can POST the form with the token and the cookie and read the response. In this case the attacker is heavily slowed down. Before each attack he has to read and parse the page. The more attacks he runs in parallel, the slower ALL of his attacks get. In fact the slowdown is exponential, not linear. That is to say that running 50 attacks at the same time will be dozens of times slower than running 10 attacks at the same time.

Let's assume a simple 4-digit password (e.g. 1234) is being used. The average number of tries required to crack it is 5,000. Obviously, in scenario B the attack will take dozens of times more time than scenario A. Therefore tokens make brute force attacks impractical and that's why we need cookies.

The only alternative to cookies is riding our time machine and going back to 2002 when we had PHP put the PHP session ID in the URL, leading to uncanny and insecure URLs. Insecure! If you gave that URL to your friend he might be able to "steal" your session unless the script was doing IP checks, which were pointless because of IPv4 and NAT and so on. There's a reason why everyone started using cookies, for crying out loud! So, the EU is basically trying to take us a DECADE into the past, where copying a URL could lead to security issues. And all that in the era of Facebook and Twitter when sharing URLs is just too common. On the grounds of "protecting privacy". EU: where reason comes to die.

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

jjst135
Thanks for explaining this.

About the cookie law: I now use the 'implied concent' for my website. I think notifying the user of the usage of cookies and also explaining what cookies are being used (and why)in an privacy policy should be enough for the use of 'non invasive cookies'. I also think this will be the way the law is going to be changed / implemented.

I consider tracking cookies (Analytics) to be 'non invasive' cookies.

nicholas
Akeeba Staff
Manager
Having a privacy policy is OK for implied consent to your own site's cookies. I've also detailed the use of third party cookies on my own privacy policy. I am not sure if the Analytics cookies fall under the non-invasive cookies provisioning of the law. I assume that since the user is given instructions in the Privacy Policy to visit Google and opt-out from the cookies they are OK. But I am not a lawyer and you may have to ask one :)

Nicholas K. Dionysopoulos

Lead Developer and Director

πŸ‡¬πŸ‡·Greek: native πŸ‡¬πŸ‡§English: excellent πŸ‡«πŸ‡·French: basic β€’ πŸ• My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!