Skip to content
This repository has been archived by the owner on Nov 19, 2023. It is now read-only.

Create an option to control whether $_SESSION would be used or not #2

Merged
merged 1 commit into from
Nov 7, 2017

Conversation

ironsmile
Copy link
Contributor

There are two reasons where this option could need to be false.

  1. When sessions are disabled. This may be cli programs where the
    $_SESSION variable is undefined or just a request with no session
    started.

  2. During testing. One may want to unit test his application with
    different languages. "Remembering" the language from the first run and
    then using it for all further requests makes this impossible.

The original behaviour is preserved and saving to the session is
the default behaviour. One have to explicitly add the option
saveToSession = false to change it.

There are two reasons where this option could need to be false.

1. When sessions are disabled. This may be cli programs where the
`$_SESSION` variable is undefined or just a request with no session
started.

2. During testing. One may want to unit test his application with
different languages. "Remembering" the language from the first run and
then using it for all further requests makes this impossible.

The original behaviour is preserved and saving to the session is
the default behaviour. One have to explicitly add the option
`saveToSession = false` to change it.
@mcaskill mcaskill merged commit a79d902 into mcaskill:master Nov 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants