Closed jpelizza closed 2 years ago
You must do all changes in session before you generate any output or request response().out()
Session is saved upon output stream request - since at this point all cookies must be send (HTTP headers prior to content) Once you write some output session is saved and you can't modify one.
Will keep that in mind, thanks.
Hi, I've recently started learning web development and took interest in this project, I'm using it to learn a bit. I'm not sure if it's a bug or a concept I'm not aware of, I just made a small example for myself on how to use sessions, it goes like this: main.cpp is a basic copy paste from the examples.
hello.cpp is where my problem lies, on welcomePage every time I refresh the page the sessions starts blank, the response is "hi" and by the end it prints "Session ends: 1" on the terminal, from my understanding the idea is that a session is kept between pages, so I can easily fetch information like user login data, but I can't seem to save the changes made.
here is the config file, also taken from the examples:
Thanks for your time.