All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.imunity.vaadin.endpoint.common.LanguageCookie Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) 2021 Bixbit - Krzysztof Benedyczak. All rights reserved.
 * See LICENCE.txt file for licensing information.
 */

package io.imunity.vaadin.endpoint.common;

import jakarta.servlet.http.Cookie;
import java.time.Duration;

public class LanguageCookie extends Cookie
{
	public static final String LANGUAGE_COOKIE = "language";
	public static final Duration LANGUAGE_COOKIE_MAX_AGE = Duration.ofSeconds(3600 * 24 * 31);

	public LanguageCookie(String lang)
	{
		super(LANGUAGE_COOKIE, lang);
		setPath("/");
		setMaxAge(Long.valueOf(LANGUAGE_COOKIE_MAX_AGE.toSeconds()).intValue());
		setHttpOnly(true);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy