How to maintain sessions with C ++ code?

C ++ has cgi code. Web pages do not currently have session management. You must provide sessions on web pages so that the user can log in, save the session, and then log out. Although this is a fairly simple task in Java with HttpSession, I have no idea how to do this with C ++ code.

+4
source share
2 answers

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

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

+2
source

Another alternative could be the "FastCGI / CGI C ++ Library", which is designed to integrate with Boost someday: http://cgi.sourceforge.net/

He claims to provide "Configurable support for strongly typed sessions (optional)."

+1
source

Source: https://habr.com/ru/post/1286328/


All Articles