Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: how cookies simultaneously work for both url one with www. and one does not  (Read 3395 times)

0 Members and 1 Guest are viewing this topic.

alanlai

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 53
    • Goddess

how cookies simultaneously work for both url one with www. and one does not


cookies treat not the same with:
http://www.sample.com VS http://sample.com

how to make one single cookies work for both?

Nibbler

  • Guest

That's how cookies work. If you want them to work across subdomains then you need to create them with a domain of ".sample.com". Coppermine doesn't have a cookie domain setting however.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de

Use a custom .htaccess file that takes care of the leading www subdomain to go out of harm's way.

To always use the leading www subdomain, use something like
Code: [Select]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]

To always redirect from the leading www subdomain to just the domain, use something like
Code: [Select]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^.*$ http://domain.com%{REQUEST_URI} [R=301,L]
If you need details on that technology, google for it, as this is not related to coppermine.
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 20 queries.