npm i express mysql express-session body-parser cookie-parser
#### How to use our forum
The header of our forum has the name on the top left and most of the implemented page elements on the right.
...
...
@@ -18,10 +21,9 @@ page, where username, picture and all posts created by the user are shown.
#### Implementation of Session in Server.js
Session is implemented, but does not work correctly.
When 8081 is accessed directly there is no problem saving and accessing the userId saved on req.session.userId, but when accessed from frontend (8080) the session is not accessible.
The method we have chosen to use for implementing session was probably not the optimal and we dont know if it is an error with the implementation, or if the method is not meant for this kind of use.
Throughout the code we therefore have changed "req.session.userId" to "1", to simulate each function as run by a user logged in as user "1".
/redirectLogin and /redirectHome still works because they apparently allow for req.session.userId to be "undefined" insted of empty.
The method we have chosen to use for implementing session was probably not the optimal and we dont know if it is an error with the implementation or that the method is not meant for this kind of use.
throughout the code we therefore have changed "req.session.userId" with "1", to simulate each function as logged in with user "1".
/redirectLogin and /redirectHome stillworks because it aparantly allow that req.session.userId is "undefined" insted of empty.
We sent mail to Aland asking about help for this issue, but did not receive a reply. Based on the information that was communicated by
reference group members regarding loosening the strictness of evaluation criteria, combined with a lot of work focusing on our graded