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

org.ikasan.dashboard.ui.util.CookieUtil Maven / Gradle / Ivy

The newest version!
package org.ikasan.dashboard.ui.util;

import com.vaadin.flow.server.VaadinRequest;
import jakarta.servlet.http.Cookie;

public class CookieUtil {

    public static Cookie getCookieByName(String name, VaadinRequest request) {
        // Fetch all cookies from the request
        Cookie[] cookies = request.getCookies();

        // Iterate to find cookie by its name
        try {
            for (Cookie cookie : cookies) {
                if (name.equals(cookie.getName())) {
                    return cookie;
                }
            }
        } catch (NullPointerException e) {
        }
        return null;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy