Giter Club home page Giter Club logo

Comments (4)

wcamarao avatar wcamarao commented on June 20, 2024

This feature request seems related to socket.io to me, so I'm closing this and will ask you to post your feature request on socket.io repo.

from session.socket.io.

Skeukry avatar Skeukry commented on June 20, 2024

not socket.io related :(

from session.socket.io.

wcamarao avatar wcamarao commented on June 20, 2024

Can you show how it is related to SessionSockets? So we can reopen the issue and investigate. Thanks

from session.socket.io.

Skeukry avatar Skeukry commented on June 20, 2024

I thought that save() function is provided by session.socket.io and that's why I thought it's related to sessionsockets.
In the end I printed out save() in the console and got this:

function (fn){
  this.req.sessionStore.set(this.id, this, fn || function(){});
  return this;
}

It seems to use the sessionstore that I passed into sessionsockets and it seems like it would have a callback.
I tried out this code:

//... Some stuff here
session.name = 'example';
session.userid = 'example';
session.save(function(){
    console.log('Callback');
});
console.log('After save');
// ... Some other stuff

This is the result log:

...
After Save
Callback
...

So save() probably has an optional callback, but I'm not 100% sure if it gets called after saving is done.

Sorry for requesting a feature that already exists, but I haven't found any information about save() other than this:

//at this point the value is not yet saved into the session
  session.save();
//now you can read session.foo from your express routes or connect middlewares

from session.socket.io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.