5

I'm using express to write a web app. The app works well on my localhost. But while I upload it to appfog, it have such problem:

After I login in the login page, I open a page with iframe ( the iframe is the same domain), the browser(chrome) give it a new cookies!

If I open the iframed(child) page first after login, then open the father page, it works fine with the same cookies.

I use this code about session:

var memstore = express.session.MemoryStore;

app.configure(function(){
  app.use(express.cookieParser('your secret here'));
  app.use(express.session({cookie: {maxAge: 2000000}, store: memstore({
    reapInterval: 60000 * 10
  }), secret: 'your secret here'}));
});

And I'm using this to destroy session:

req.session.destroy();

The logout page is in the iframe, too.

Bin Wang
  • 2,697
  • 2
  • 24
  • 34

0 Answers0