Page 1 of 1

user_ctx vs sess_ctx in http server

Posted: Tue Oct 04, 2022 2:20 pm
by rokko1337
What is the main difference between user_ctx and sess_ctx? Is sess_ctx different for each session/connection and user_ctx is not, in this case what is the point of user_ctx and in which scenario you recommend to use it? In restful_server example it's used to store server response, but why you can't respond directly with httpd_resp_send()? Also in which cases ws_user_ctx is used and what I should use to store user data (for example access role) for each WebSocket connection?