如何保持与 C++ 的会话 代码?

发布于 2024-07-24 23:17:45 字数 131 浏览 4 评论 0原文

有一段用C++编写的cgi代码。 目前网页中没有进行会话管理。 需要在网页中提供会话,以便用户可以登录、保持会话、然后注销。 虽然这是使用 HttpSession 在 java 中相当简单的任务,但我不知道如何使用 C++ 代码来完成此任务。

There is a cgi code written in C++. Currently there is no session management done in the web pages. There is a need to provide sessions in the web pages so that the user can login, maintain session and then logoff. While this is a fairly simple task in java with HttpSession, I have no clue how to do this with C++ code.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

和影子一齐双人舞 2024-07-31 23:17:45

C++ 在捆绑库的功能广度方面与 Java 不同,因此您需要使用一些额外的库来扩展该语言,以完成不那么常见的任务(例如 C++ CGI 开发)。 您可以自己构建该库来支持标准库中不存在的功能,也可以使用第三方开发的库。

在本例中,我将使用 NCBI C++ 工具包。 它提供了一个很好的 CGI 模块会话支持

C++ is not like Java in the breadth of the functionality of the bundled libraries, so you need to extend the language with some extra libraries for not so common tasks (such as C++ CGI development). You can either build the library yourself to support functionality not present in the standard library, or use one developed by a third party.

In this case I'd use the NCBI C++ Toolkit. It provides a nice CGI module with session support

川水往事 2024-07-31 23:17:45

另一种选择可能是“FastCGI / CGI C++ Library”,旨在有一天实现 Boost 集成:http://cgi.sourceforge .net/

它声称自己提供“对强类型会话的可配置支持(可选)”。

Another alternative may be the "FastCGI / CGI C++ Library" that is aimed for Boost integration at someday: http://cgi.sourceforge.net/

It claims itself to provide "Configurable support for strongly-typed sessions (optional)."

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文