How to maintain sessions with C++ code?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 05:19:52

问题


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.


回答1:


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




回答2:


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)."



来源:https://stackoverflow.com/questions/1005242/how-to-maintain-sessions-with-c-code

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!