Static content, such as images, JS and CSS files, don't need to be accompanied by cookies, as there is no user interaction with these resources, so many web projects use a dedicated domain / subdomain (e.g. static.example.org) for that. If you create a own joomla template you normally moved your "static" web design elements like graphics (e.g. *.png), javascript (e.g. *.jsp) and your Cascade style sheets (*.css) to a subdomain. Now you wish to prevent that a cookie is created on that subdomain. How can this be done?

Add the following lines to your .htaccess inside your image, jsp or css folder:

########## Begin - Disable cookies for static elements subdomain
#
#
<IfModule mod_php5.c>
php_value session.use_cookies 0
</IfModule>
#
<IfModule mod_php4.c>
php_value session.use_cookies 0
</IfModule>
#
#
########## End - Disable cookies for static elements subdomain

For more infos regarding that topic read:

Serve static content from a cookieless domain

Comments (2)

  1. sicorps

this solution is not working..

  Attachments
 
  1. Bernd Webster    sicorps

Just tested this and it works quite well ... no issue found ... it still works in Jommla 3.2. BUT it might not work for your configuration. This depends more on the host you are using.

  Attachments
 
There are no comments posted here yet

Leave your comments

Posting comment as a guest.
Attachments (0 / 3)
Share Your Location