You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you for creating this package. MySql was my first dive into programming, so it has always remained popular to me when I use DB's for coding. Hopefully this will be a quick question, and if it turns out it is something I need to ask express-sessions please let me know.
My question being: "How is the value for the 'expires' column inside of the sessions table generated?". Pic below
Everything is working as I thought it would as far as setting the session to expire and having the session removed. So no errors or issues there, but the 'expires' column seems to just be set to around 1708116620ms or something similar to 1708XXXXXXms. This isn't impacting my application as the cookie and session are still being deleted, but I'm just trying to understand where that value is coming from.
Below is my code, unrelated code was truncated for brevity.
The expires value in the sessions table comes from the cookie.expires value (if it is used) or the current timestamp plus the expiration option time. See the following code as a reference:
letexpires;if(data.cookie){if(data.cookie.expires){expires=data.cookie.expires;}elseif(data.cookie._expires){expires=data.cookie._expires;}}if(!expires){expires=Date.now()+this.options.expiration;}if(!(expiresinstanceofDate)){expires=newDate(expires);}// Use whole seconds here; not milliseconds.expires=Math.round(expires.getTime()/1000);
Hi Chill117,
First of all, thank you for creating this package. MySql was my first dive into programming, so it has always remained popular to me when I use DB's for coding. Hopefully this will be a quick question, and if it turns out it is something I need to ask express-sessions please let me know.
My question being: "How is the value for the 'expires' column inside of the sessions table generated?". Pic below
Everything is working as I thought it would as far as setting the session to expire and having the session removed. So no errors or issues there, but the 'expires' column seems to just be set to around 1708116620ms or something similar to 1708XXXXXXms. This isn't impacting my application as the cookie and session are still being deleted, but I'm just trying to understand where that value is coming from.
Below is my code, unrelated code was truncated for brevity.
session.js file
server.js file
db_connection.js for pool
Once again, thank you very much and appreciate the work that went into this!
-Tim
The text was updated successfully, but these errors were encountered: