安全的方式连接code C#中的cookie值 [英] Safe way to encode a cookie value in c#

查看:148
本文介绍了安全的方式连接code C#中的cookie值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用C#在cookie中存储的值,什么是EN code(或转义)价值的最佳方式,以便它可以进行检索和德codeD /反向转义可靠?

When storing a value in a cookie using C#, what is the best way to encode (or escape) the value so that it can be retrieved and decoded/unescaped reliably?

我不是在谈论加密。

推荐答案

好了,最安全的做法是使用URL编码(使用HttpServerUtility.UrlEn code)。

Well, the safest thing to do is use UrlEncoding (use HttpServerUtility.UrlEncode).

这篇关于安全的方式连接code C#中的cookie值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆