001/**
002 *
003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved.
004 *
005 * This library is free software; you can redistribute it and/or
006 * modify it under the terms of the GNU Lesser General Public
007 * License as published by the Free Software Foundation; either 
008 * version 2.1 of the License, or (at your option) any later version.
009 * 
010 * This library is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013 * Lesser General Public License for more details.
014 * 
015 * You should have received a copy of the GNU Lesser General Public 
016 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
017 * 
018 **/
019package lucee.runtime.type.scope;
020
021import lucee.runtime.exp.PageException;
022import lucee.runtime.type.Collection;
023
024/**
025 * interface for the cookie scope
026 */
027public interface Cookie extends Scope, UserScope {
028
029        /**
030     * set a cookie value
031     * @param name name of the cookie
032     * @param value value of the cookie
033     * @param expires expirs of the cookie (Date, number in seconds or keyword as string )
034     * @param secure set secure or not
035     * @param path path of the cookie
036     * @param domain domain of the cookie
037     * @throws PageException 
038     * @deprecated
039     */
040        public abstract void setCookie(Collection.Key name, Object value, Object expires, boolean secure, String path, String domain) throws PageException;
041
042        
043        /**
044     * set a cookie value
045     * @param name Name of the cookie
046     * @param value value of the cookie
047     * @param expires expires in seconds
048     * @param secure secute or not
049     * @param path path of the cookie
050     * @param domain domain of the cookie
051     * @throws PageException
052     * @deprecated
053     */
054        public abstract void setCookie(Collection.Key name, Object value, int expires, boolean secure, String path, String domain) throws PageException;
055
056    
057    /**
058     * set a cookie value
059     * @param name Name of the cookie
060     * @param value value of the cookie
061     * @param expires expires in seconds
062     * @param secure secute or not
063     * @param path path of the cookie
064     * @param domain domain of the cookie
065     * @deprecated
066     */
067    public abstract void setCookieEL(Collection.Key name, Object value, int expires, boolean secure, String path, String domain);
068    
069
070
071        /**
072     * set a cookie value
073     * @param name name of the cookie
074     * @param value value of the cookie
075     * @param expires expirs of the cookie (Date, number in seconds or keyword as string )
076     * @param secure set secure or not
077     * @param path path of the cookie
078     * @param domain domain of the cookie
079     * @param httpOnly if true, sets cookie as httponly so that it cannot be accessed using JavaScripts. Note that the browser must have httponly compatibility.
080     * @param preserveCase if true, keep the case of the name as it is
081     * @param encode if true, url encode the name and the value
082     * @throws PageException 
083     */
084        public abstract void setCookie(Collection.Key name, Object value, Object expires, boolean secure, String path, String domain, 
085                        boolean httpOnly, boolean preserveCase, boolean encode) throws PageException;
086
087        
088        /**
089     * set a cookie value
090     * @param name Name of the cookie
091     * @param value value of the cookie
092     * @param expires expires in seconds
093     * @param secure secute or not
094     * @param path path of the cookie
095     * @param domain domain of the cookie
096     * @param httpOnly if true, sets cookie as httponly so that it cannot be accessed using JavaScripts. Note that the browser must have httponly compatibility.
097     * @param preserveCase if true, keep the case of the name as it is
098     * @param encode if true, url encode the name and the value
099     * @throws PageException
100     */
101        public abstract void setCookie(Collection.Key name, Object value, int expires, boolean secure, String path, String domain, 
102                        boolean httpOnly, boolean preserveCase, boolean encode) throws PageException;
103
104    
105    /**
106     * set a cookie value
107     * @param name Name of the cookie
108     * @param value value of the cookie
109     * @param expires expires in seconds
110     * @param secure secute or not
111     * @param path path of the cookie
112     * @param domain domain of the cookie
113     * @param httpOnly if true, sets cookie as httponly so that it cannot be accessed using JavaScripts. Note that the browser must have httponly compatibility.
114     * @param preserveCase if true, keep the case of the name as it is
115     * @param encode if true, url encode the name and the value
116     */
117    public abstract void setCookieEL(Collection.Key name, Object value, int expires, boolean secure, String path, String domain, 
118                boolean httpOnly, boolean preserveCase, boolean encode);
119    
120   
121        
122
123}