前端获取Cookie方法

  <%
                    Cookie[] cookies = request.getCookies();   
       if (cookies != null) {   
           Cookie cookie;   
           for (int i = 0; i < cookies.length; i++) {   
               cookie = cookies[i];   

                cookie.getName();  

cookie.getValue(); 

               System.out.print(cookie.getName()+"----"+cookie.getValue());
           }
        }   
           %>

猜你喜欢

转载自blog.csdn.net/yulei2008_/article/details/77719563