Here I used the express-session to store user session but only to find that the req.session.user always undefined.
It's funny that when I used chrome plugin postman to visit, there's no problem.
so how to fix it ?
var session =…
In my frontend react application, I am trying to check if a session cookie exists, as this will help me decide whether to show a login page (if no session cookie exists or invalidated), or show content page.
The backend express-session middleware…
express-session is refusing to save the session data for my users.
It is saving the session cookie, but the data is not persisting.
Here is my server.js.
Hi. When i print the req.session.mySessValue in UI , the value is empty. I think the assigning of req.session.mySessValue = dt.myValue; (express-session) is not proper.…
I have a database in mongo to store session state called 'SessionStore' with a collection called 'Sessions' to store session state.
I'm using expression-session for managing sessions.
Code to setup sessions is as follows;
var session =…
I currently have a chrome extension that GET's javascript from my node.js server. However the javascript file I want to serve will depend on the number of times https://www.google.co.uk/ has been visited.
I want to perform this on the server side,…
This simple bit of code illustrates the problem: The second session does not save. How can I make this work?
router.post('/users/login', function (req, res) {
var db = req.usersDb;
var users = db.get('users');
req.session.test = "This works";
…
So I'm building an app with angular on the front and nodejs/express on the backend. My problem is that when using express-session, each request creates a new session cookie.
I have searched through a lot of questions and answers but it seems that…
I'm new to node.js and sessions, I'm trying to store some values in the node.js session, but everytime I reload the page and check the console.log the session haven't been saved. My code:
var session;
var org;
function checkSession(argument){
var…
I need to remove mongodb documents after a specified period of not being accessed.
I have a access token I use to retrieve data from an external source and save it in my database.
In my session I store a user id I can use the retrieve the access…
I am making a chat for customers of a web page, with express.js, and socket.io, and I'm trying to manage sessions with express-session, my problem is, how do I read the session values on the socket.
Here's part of my code.
Thanks for the help :)
var…
I have a route written in Express as the following:
app.get("/route", function(req, res){
if (someBoolean){
someFunction(stuff, function(user){
...
req.session.user = user;
});
}
…
My application is currently being opened from my file system and makes requests to a server hosted on cloud 9. Whenever I submit information from the same page I make two requests from the same page.
One request is to create a new resource and the…
I am currently working on a web application that requires an user login snippet. I have built an API for getting user information and others. But I cannot let NodeJS work with sessions.
So, I have an API endpoint like this for logging in:…