In programming is the meaning of the conversation
The Session object stores the information that is required for a specific user session. This way, when a user jumps between the application's Web pages, the variables stored in the session object are not lost, but persist throughout the user's session.
When a user requests a Web page from an application, if the user does not yet have a session, the Web server automatically creates a Session object. When the session expires or is discarded, the server terminates the session.
One of the most common uses of Session objects is to store the user's preferences. For example, if a user indicates that they do not like to view a graphic, they can store the information in the Session object. For more information about using session objects, see "Managing Sessions" in the ASP Application section.
**************************
Alas, the previous system session is always inexplicably lost, not in the server process.
is always lost, and then the client quits for no reason. You do not have to set the session time to 1 hours.
Finally helpless, put the session in the database. Ha, the problem is solved.
It took 1 weeks. No customer reflects the problem for the time being.
Maybe everyone's needs are different, but I still feel that the session in the database insurance.
**************************
Can put MONGO also can put redis inside.
It's more than a redis inside.
Node in the express session, we usually put in Redis, and the rest of him to help us automatically manage. Destruction and so on.
*************************
In the Miss Lei Project:
var session = require (' express-session ');
var Redisstore = require (' Connect-redis ') (session);
Store:new redisstore (CONF. Session_redis),
session_redis:{
port:6379,
port:6379,
Host: ' 127.0.0.1 '
Host: ' 10.150.160.136 '
},
Only the IP and port of the database are given.
In the Miss Shen Project:
var session = require (' express-session ');
var Redisstore = require (' Connect-redis ') (session);
Options.store = new Redisstore ({retry_max_delay:5000, max_attempts:3});
Session in the database to solve the lost problem