什么是防止会话劫持的最佳方法?(What is the best way to prevent session hijacking?)
具体来说,这是关于何时使用客户端会话cookie来标识服务器上的会话。
是对整个网站使用SSL / HTTPS加密的最佳答案,您有最好的保证,中间人员中没有人能够嗅探现有的客户端会话cookie?
也许第二好使用存储在会话cookie中的会话值本身使用某种加密?
如果恶意用户对机器进行物理访问,他们仍然可以查看文件系统来检索有效的会话cookie,并使用它来劫持会话?
Specifically this is regarding when using a client session cookie to identify a session on the server.
Is the best answer to use SSL/HTTPS encryption for the entire web site, and you have the best guarantee that no man in the middle attacks will be able to sniff an existing client session cookie?
And perhaps second best to use some sort of encryption on the session value itself that is stored in your session cookie?
If a malicious user has physical access to a machine, they can still look at the filesystem to retrieve a valid session cookie and use that to hijack a session?
原文:https://stackoverflow.com/questions/22880
最满意答案
在项目中添加一个引用,并在CS文件的顶部使用using子句。
添加引用:
- 在Visual Studio中,单击项目,然后单击添加引用。
- 单击浏览选项卡,找到要添加引用的DLL。
注意:如果要使用的DLL在同一个项目中,显然使用浏览是不好的形式。 而是右键单击项目,然后单击添加引用,然后从项目选项卡中选择相应的类:
- 单击确定。
添加using子句:
添加“使用[namespace];” 到您要引用库的CS文件。 因此,如果要引用的库有一个名为MyLibrary的命名空间,请将以下内容添加到CS文件中:
using MyLibrary;
Add a reference to it in your project and a using clause at the top of the CS file where you want to use it.
Adding a reference:
- In Visual Studio, click Project, and then Add Reference.
- Click the Browse tab and locate the DLL you want to add a reference to.
NOTE: Apparently using Browse is bad form if the DLL you want to use is in the same project. Instead, right-click the Project and then click Add Reference, then select the appropriate class from the Project tab:
- Click OK.
Adding a using clause:
Add "using [namespace];" to the CS file where you want to reference your library. So, if the library you want to reference has a namespace called MyLibrary, add the following to the CS file:
using MyLibrary;
相关问答
更多-
TCP/IP模型是一个________。[2023-10-02]
a -
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
在F#项目中使用C#库?(Using C# library in an F# project?)[2021-07-31]
如果F#环境可以找到Rdiosharp.dll的位置,则以下代码Rdiosharp.dll 。 通常不会! 所以它不起作用,并告诉你“错误FS0084:程序集引用”RdioSharp.dll“未找到或无效”。 #r "RdioSharp.dll" 您可以提供此dll的确切路径,如下所示: #r @"c:\temp\RdioSharp.dll" 或者您可以将其文件夹添加到搜索路径中: #I @"c:\temp" The following code works if F# environment can ... -
您需要添加一系列C# 平台调用方法定义。 这告诉C#如何调用.dll,并直接使用C API。 标题和库文件完全没有使用。 You need to add a series of C# Platform Invocation method definitions. This tells C# how to call into the .dll, and use the C API directly. The header and library files are completely unused.
-
在项目中添加一个引用,并在CS文件的顶部使用using子句。 添加引用: 在Visual Studio中,单击项目,然后单击添加引用。 单击浏览选项卡,找到要添加引用的DLL。 注意:如果要使用的DLL在同一个项目中,显然使用浏览是不好的形式。 而是右键单击项目,然后单击添加引用,然后从项目选项卡中选择相应的类: 单击确定。 添加using子句: 添加“使用[namespace];” 到您要引用库的CS文件。 因此,如果要引用的库有一个名为MyLibrary的命名空间,请将以下内容添加到CS文件中: usi ...
-
只需从P2添加对P1的引用 Simply add reference to P1 from P2
-
我认为这是一个com可见的.net程序集,你应该直接添加.net程序集作为.net组件。 您链接的技术是如何编写可以从VB6引用的.net程序集。 无需将其添加为.net项目的com引用,只需将其添加为普通的.net引用即可。 I think it is saying it is a com visible .net assembly and you should add the .net assembly directly as a .net assenbly. The technique you lin ...
-
使用C#库(Using a C# library)[2023-08-26]
您链接的页面中的说明建议您在添加引用时浏览到库的已编译DLL。 我不知道他们为什么会这么推荐。 有点奇怪。 只有当库的编译二进制文件是你所拥有的时候才应该使用它。 通常的建议做法是将两个项目(库和使用该库的项目)添加到同一解决方案中,这样您就可以在Visual Studio中一起编辑它们,并将它们一起编译。 然后,在“ 添加引用”对话框中,使用“ 项目”选项卡而不是“ 浏览”选项卡,该选项卡将列出您的库。 这样,您的代码将始终了解库中的所有最新更改。 如果在库中声明一个新类型,则可以立即在另一个项目中使用它 ... -
为什么这个C#类库项目无法创建COM兼容的DLL?(Why is this C# Class Library project unable to create a COM compatible DLL?)[2023-04-10]
不要忘记这篇文章 ,通过注册课程来引导你。 Not to forget this post that steps you thru registering the class. -
您可以创建一个DLL,在其中为.lib中的每个函数创建包装函数: extern "C" __declspec (dllexport) HANDLE OpenFile(char const * filename) { return open_file(filename); } 在C#中,您使用P / Invoke使dll函数可用: [DllImport("WrapperLib.dll")] private static extern System.IntPtr OpenFile(string fil ...