/**
 * Copyright (c) 2014, the Railo Company Ltd.
 * Copyright (c) 2015, Lucee Assosication Switzerland
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either 
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public 
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */
package lucee.runtime.type.scope;

import lucee.runtime.exp.PageException;
import lucee.runtime.type.Collection;

/**
 * interface for the cookie scope
 */
public interface Cookie extends Scope, UserScope {

	/**
	 * set a cookie value
	 * 
	 * @param name name of the cookie
	 * @param value value of the cookie
	 * @param expires expirs of the cookie (Date, number in seconds or keyword as string )
	 * @param secure set secure or not
	 * @param path path of the cookie
	 * @param domain domain of the cookie
	 * @throws PageException
	 * @deprecated
	 */
	@Deprecated
	public abstract void setCookie(Collection.Key name, Object value, Object expires, boolean secure, String path, String domain) throws PageException;

	/**
	 * set a cookie value
	 * 
	 * @param name Name of the cookie
	 * @param value value of the cookie
	 * @param expires expires in seconds
	 * @param secure secute or not
	 * @param path path of the cookie
	 * @param domain domain of the cookie
	 * @throws PageException
	 * @deprecated
	 */
	@Deprecated
	public abstract void setCookie(Collection.Key name, Object value, int expires, boolean secure, String path, String domain) throws PageException;

	/**
	 * set a cookie value
	 * 
	 * @param name Name of the cookie
	 * @param value value of the cookie
	 * @param expires expires in seconds
	 * @param secure secute or not
	 * @param path path of the cookie
	 * @param domain domain of the cookie
	 * @deprecated
	 */
	@Deprecated
	public abstract void setCookieEL(Collection.Key name, Object value, int expires, boolean secure, String path, String domain);

	/**
	 * set a cookie value
	 * 
	 * @param name name of the cookie
	 * @param value value of the cookie
	 * @param expires expirs of the cookie (Date, number in seconds or keyword as string )
	 * @param secure set secure or not
	 * @param path path of the cookie
	 * @param domain domain of the cookie
	 * @param httpOnly if true, sets cookie as httponly so that it cannot be accessed using JavaScripts.
	 *            Note that the browser must have httponly compatibility.
	 * @param preserveCase if true, keep the case of the name as it is
	 * @param encode if true, url encode the name and the value
	 * @throws PageException
	 */
	public abstract void setCookie(Collection.Key name, Object value, Object expires, boolean secure, String path, String domain, boolean httpOnly, boolean preserveCase,
			boolean encode) throws PageException;

	/**
	 * set a cookie value
	 * 
	 * @param name Name of the cookie
	 * @param value value of the cookie
	 * @param expires expires in seconds
	 * @param secure secute or not
	 * @param path path of the cookie
	 * @param domain domain of the cookie
	 * @param httpOnly if true, sets cookie as httponly so that it cannot be accessed using JavaScripts.
	 *            Note that the browser must have httponly compatibility.
	 * @param preserveCase if true, keep the case of the name as it is
	 * @param encode if true, url encode the name and the value
	 * @throws PageException
	 */
	public abstract void setCookie(Collection.Key name, Object value, int expires, boolean secure, String path, String domain, boolean httpOnly, boolean preserveCase,
			boolean encode) throws PageException;

	/**
	 * set a cookie value
	 * 
	 * @param name Name of the cookie
	 * @param value value of the cookie
	 * @param expires expires in seconds
	 * @param secure secute or not
	 * @param path path of the cookie
	 * @param domain domain of the cookie
	 * @param httpOnly if true, sets cookie as httponly so that it cannot be accessed using JavaScripts.
	 *            Note that the browser must have httponly compatibility.
	 * @param preserveCase if true, keep the case of the name as it is
	 * @param encode if true, url encode the name and the value
	 */
	public abstract void setCookieEL(Collection.Key name, Object value, int expires, boolean secure, String path, String domain, boolean httpOnly, boolean preserveCase,
			boolean encode);

}
@@ -1469,32 +1469,49 @@
 h, String domain
+, String samesite
 ) throws PageExc
@@ -1510,32 +1510,32 @@
  PageException;%0A
-
 %0A%09/**%0A%09 * set a 
@@ -1950,16 +1950,33 @@
 g domain
+, String samesite
 ) throws
@@ -2399,16 +2399,33 @@
 g domain
+, String samesite
 );%0A%0A%09/**
@@ -3232,32 +3232,49 @@
 %09%09boolean encode
+, String samesite
 ) throws PageExc
@@ -4045,16 +4045,33 @@
 n encode
+, String samesite
 ) throws
@@ -4801,32 +4801,32 @@
 n preserveCase,%0A
-
 %09%09%09boolean encod
@@ -4826,13 +4826,30 @@
 n encode
+, String samesite
 );%0A%0A%7D

Update Cookie.java