bump language cookie in login_sequence

This commit is contained in:
Andrew Dolgov 2007-08-11 17:03:31 +01:00
parent 6a214f923d
commit 019bd5a951
2 changed files with 7 additions and 2 deletions

View File

@ -10,7 +10,7 @@
function get_translations() {
$tr = array(
"" => "Detect automatically",
"auto" => "Detect automatically",
"en_US" => "English",
"fr_FR" => "Français",
"ru_RU" => "Русский",
@ -1413,6 +1413,11 @@
/* bump login timestamp */
db_query($link, "UPDATE ttrss_users SET last_login = NOW() WHERE id = " .
$_SESSION["uid"]);
if ($_SESSION["language"]) {
setcookie("ttrss_lang", $_SESSION["language"],
time() + SESSION_COOKIE_LIFETIME);
}
}
} else {

View File

@ -25,7 +25,7 @@ function init() {
}
function languageChange(elem) {
var lang = elem[elem.selectedIndex].value;
setCookie("ttrss_lang", lang);
setCookie("ttrss_lang", lang, <?php print SESSION_COOKIE_LIFETIME ?>);
window.location.reload();
}
</script>