使用Cookie报错Control character in cookie value, consider BASE64 encoding your value
参考资料:
http://www.blogjava.net/persister/archive/2009/10/02/297103.html
http://blog.csdn.net/xiaozhengdong/article/details/7499020
http://www.blogjava.net/andy-huang/articles/base64.html
在创建Cookie的时候不能直接写入中文,如果要的话,需要进行转码。如果你手头有BASE64Encoder和BASE64Decoder的API的话,如下:
public static String encryptBASE64(byte[] key) throws Exception public static byte[] decryptBASE64(String key) throws Exception
对你要写的字符串进行编码解码即可。sun.misc的Base64类不建议使用(我这里根本找不到这个类)。
使用Cookie报错Control character in cookie value, consider BASE64 encoding your value的更多相关文章
- cookie遇到java.lang.IllegalArgumentException: Control character in cookie value or attribute
java.lang.IllegalArgumentException: Control character in cookie value or attribute. 该异常说明cookie中的val ...
- Cookie存储中文报错:java.lang.IllegalArgumentException: Control character in cookie value or attribute.(转)
项目中做自动登录和保存密码时,Cookie报错Java.lang.IllegalArgumentException,上google查了下 在http://hi.baidu.com/xtxycy/blo ...
- Control character in cookie value, consider BASE64 encoding your value , java操作cookie遇到中文会报错的解决方案
项目当中用到cookie保存中文,但是会报如下错误: Control character in cookie value, consider BASE64 encoding your value 大概 ...
- tomcat使用cookies缓存的时候中文报错解决办法 java.lang.IllegalArgumentException: Control character in cookie value or attribute.
报错出现 java.lang.IllegalArgumentException: Control character in cookie value or attribute. at org.apac ...
- Control character in cookie value, consider BASE64 encoding your value-Cookie保存中文出错[转]
项目当中用到cookie保存中文,但是会报如下错误: Control character in cookie value, consider BASE64 encoding your value 大概 ...
- 解决Tomcat的IllegalArgumentException: Control character in cookie value or attribute错误
接口中带有中文,tomcat8 17-Apr-2019 13:21:23.734 严重 [http-nio-8082-exec-2] org.apache.coyote.http11.Abstract ...
- 异常:java.lang.IllegalArgumentException: Control character in cookie value or attribute.
后台提示: 严重: Error processing requestjava.lang.IllegalArgumentException: Control character in cookie va ...
- HTTP Status 500 - Request processing failed; nested exception is java.lang.IllegalArgumentException: Control character in cookie value or attribute.
HTTP Status 500 - Request processing failed; nested exception is java.lang.IllegalArgumentException: ...
- 创建Cookie抛出异常:java.lang.IllegalArgumentException: Control character in cookie value
调用Cookie对象的构造函数可以创建Cookie.Cookie对象的构造函数有两个字符串参数:Cookie名字和Cookie值. 名字和值都不能包含空白字符以及下列字符:[ ] ( ) < ...
随机推荐
- iOS: FFmpeg的使用二
1.下载并编译FFMPEG. https://github.com/kewlbear/FFmpeg-iOS-build-script 下载后有一个build-ffmpeg.sh文件.终端执行即可自动下 ...
- iOS:转载:IOS谓词--NSPredicate
IOS谓词--NSPredicate 分类: IOS应用2013-02-19 17:24 6792人阅读 评论(1) 收藏 举报 Cocoa 提供了NSPredicate 用于指定过滤条件,谓词是指在 ...
- Tensorflow 之 name/variable_scope 变量管理
name/variable_scope 的作用 充分理解 name / variable_scope TensorFlow 入门笔记 当一个神经网络比较复杂.参数比较多时,就比较需要一个比较好的方式来 ...
- .net非托管资源的回收
释放未托管的资源有两种方法 1.析构函数 2.实现System.IDisposable接口 一.析构函数 构造函数可以指定必须在创建类的实例时进行的某些操作,在垃圾收集器删除对象时,也可以调用析构函数 ...
- http://blog.csdn.net/steveguoshao/article/details/38414145
http://blog.csdn.net/steveguoshao/article/details/38414145
- PHP登入网站抓取并且抓取数据
有时候需要登入网站,然后去抓取一些有用的信息,人工做的话,太累了.有的人可以很快的做到登入,但是需要在登入后再去访问其他页面始终都访问不了,因为他们没有带Cookie进去而被当做是两次会话.下面看看代 ...
- Java GC、新生代、老年代
堆内存 Java 中的堆是 JVM 所管理的最大的一块内存空间,主要用于存放各种类的实例对象.在 Java 中,堆被划分成两个不同的区域:新生代 ( Young ).老年代 ( Old ).新生代 ( ...
- XMPPFrameWork IOS 开发(四)消息和好友上下线
原始地址:XMPPFrameWork IOS 开发(四) 消息 //收到消息 - (void)xmppStream:(XMPPStream *)sender didReceiveMessage:(XM ...
- Install certificates needed for Visual Studio offline installation
Visual Studio is primarily designed for installation from an internet-connected machine, since many ...
- jquery easyui validatebox remote使用
validatebox 的validateType可以是一下3个格式: 1字符串 2数组,应用多个验证 3对象,每个key是一个验证名称value是验证的数组参数 下面是代码示例 <input ...