Skip to content
Grav 2.0 is officially stable. Read the announcement →
Support

Session_store_active has no effect

Started by William Gérald Blondel 5 years ago · 2 replies · 439 views
5 years ago

Hello!

I've been playing with Grav for a week and I like it very much so far!

I am using Grav v1.7.7 with Admin v1.10.6. My theme is Quark Open Publishing 2.2.6.
I have a little problem with the session-based storage of the active language: it doesn't seem to work.

My website's default language is French, secondary language is English. The current language is always in the url (/fr/ or /en/).

If I choose English on a page via the Language Switcher in the footer (or by modifying the URL), I get to the English page. But if I then remove the /en/ part of the URL, I get to the French page (/fr/).

Isn't it supposed to remember that I selected English? That's what I would like to do.

Maybe there is an additional setting to enable but I don't see which one.

I tried in private browsing mode, because I thought my admin session were interfering with this feature, but I had the same issue.

Relevant parts of system.yaml, related to languages and sessions:

YAML
languages:
  supported:
    - fr
    - en
  default_lang: null
  include_default_lang: true
  include_default_lang_file_extension: true
  translations: true
  translations_fallback: true
  session_store_active: true
  http_accept_language: false
  override_locale: false
  pages_fallback_only: false

session:
  enabled: true
  initialize: true
  timeout: 1800
  name: [xxxx]
  uniqueness: salt
  secure: true
  httponly: true
  samesite: Lax
  split: true
  domain: null
  path: null

Do you have an idea of what might cause the problem ?

I can give the URL of the website if needed.

Thank you.

5 years ago

@wblondel, It seems that setting session_store_active: true will never have any effect, because the language is determined before the session has been initialised. The language is never stored in, nor retrieved from the session.

I've created issue #3269 on Github describing the behaviour.

👍 1
5 years ago

@wblondel, Would you mind testing the 'develop' branch of Grav and see if it works for you now?

BASH
$ git clone https://github.com/getgrav/grav -b develop .
$ composer install

Suggested topics

Topic Participants Replies Views Activity
Support · by Water Science, 3 weeks ago
6 125 6 minutes ago
Support · by Duc , 15 hours ago
1 40 15 hours ago
Support · by Thomas, 1 week ago
3 114 24 hours ago
Support · by Anna, 4 days ago
2 104 2 days ago
Support · by Justin Young, 2 days ago
1 78 2 days ago