Setting a session variable would be better: less chance of it getting damaged, then.
Take a look at the headers sent by the client when they first visit ($_SERVER['HTTP_ACCEPT_LANGUAGE']): see what languages they prefer. You can use that as the initial value for the language until they decide to switch (if they do).
If their preference is different from what their client says in its headers, and you anticipate repeat visits, you might want to set a persistent cookie to store their preference.
So....
If there is a session variable containing the preferred language, use that.
Otherwise, if there is a persistent cookie containing the preferred language, use that.
Otherwise, if you can handle one of the languages the client specifies, use that.
Otherwise fall back on some default language.
If they specify a preference, set the session variable and the persistent cookie.