如何列出用户搜索关键字/文本使用历史记录的cookie [英] How to list user search keywords/text used history by cookies

查看:285
本文介绍了如何列出用户搜索关键字/文本使用历史记录的cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要知道如何通过cookie读取用户的搜索历史记录,即如何跟踪我的cookie并获取用户在搜索引擎中使用的关键字/文本列表。有可能请提出一些想法吗?或者我如何通过C#/ ASP.Net国家管理实现这一目标?



提前致谢。



我尝试了什么:



Cookie是域名透视图,我试图阅读自己的网站搜索历史记录,但我失败了。

I need to know how to read user's search history by cookies, i.e., how I can track my cookies and get the list of keywords/text used in the search engines by the user. Is it possible please suggest some ideas to do it? or How I can achieve this by C#/ASP.Net State management?

Thanks in advance.

What I have tried:

Cookies are the domain name perspective, I tried to read my own site search history, but I failed.

推荐答案

可通过 Request.Cookies 集合。要阅读您自定义的Cookie,您可以执行以下操作:



Cookies are available via Request.Cookies collection. To read your custom defined cookies, you can simply do something like this:

if(Request.Cookies["YourKey"]!=null)
{
   var myCookie = Request.Cookies["YourKey"].Value;
}





欲了解更多信息,请参阅此处的官方文档:如何:读取Cookie [ ^ ]



如果您尝试访问其他网站(例如搜索引擎网站)的Cookie那么你不能。您只能访问发送到您服务器的cookie。您无法阅读其他网站的cookie,这将是一个巨大的安全漏洞。



For more information, refer the official documentation here: How to: Read a Cookie[^]

If you are trying to access cookies from other websites (e.g search engine websites), then You can't. You can only access cookies sent to your server. You can't read the cookies of other websites, that would be a HUGE security flaws.


这篇关于如何列出用户搜索关键字/文本使用历史记录的cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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