#15318: A possibility to configure the language's cookie domain and expires.
------------------------------------------------+---------------------------
 Reporter:  sahid                               |          Owner:  nobody    
   Status:  new                                 |      Milestone:            
Component:  Translations                        |        Version:  1.2       
 Keywords:  cookie, domain, language, settings  |   Triage Stage:  Unreviewed
Has patch:  1                                   |  
------------------------------------------------+---------------------------
 Hello,

 A suggest a new settings: LANGUAGE_COOKIE_DOMAIN


 {{{
 Index: conf/global_settings.py
 ===================================================================
 --- conf/global_settings.py     (revision 15552)
 +++ conf/global_settings.py     (working copy)
 @@ -112,6 +112,8 @@
  USE_I18N = True
  LOCALE_PATHS = ()
  LANGUAGE_COOKIE_NAME = 'django_language'
 +LANGUAGE_COOKIE_DOMAIN = None
 +LANGUAGE_COOKIE_EXPIRES = None

  # If you set this to True, Django will format dates, numbers and
 calendars
  # according to user current locale
 Index: views/i18n.py
 ===================================================================
 --- views/i18n.py       (revision 15552)
 +++ views/i18n.py       (working copy)
 @@ -32,7 +32,11 @@
              if hasattr(request, 'session'):
                  request.session['django_language'] = lang_code
              else:
 -                response.set_cookie(settings.LANGUAGE_COOKIE_NAME,
 lang_code)
 +                response.set_cookie(
 +                    settings.LANGUAGE_COOKIE_NAME,
 +                    lang_code,
 +                    expires=settings.LANGUAGE_COOKIE_EXPIRES,
 +                    domain=settings.LANGUAGE_COOKIE_DOMAIN)
      return response

  def get_formats():
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15318>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to