TencentWSRD / connect-cas2

NodeJS implement of CAS(Central Authentication Service) client.
MIT License
107 stars 44 forks source link

I deploy two web application on a machine with different ports, the session expires #14

Open fyzwjd opened 6 years ago

fyzwjd commented 6 years ago

I deploy two web application on a machine with different ports. Then I open the application A named pageA, open the application B named pageB, everything is ok. And then I back to operate pageA, send a Ajax request to node server, the problem comes.

/ logs begin/ Doing authenticating... Can not find st in session Session { cookie: { path: '/', _expires: null, originalMaxAge: null, httpOnly: true } } Need to redirect, but matched AJAX request, send 419 / logs end/

I found that the infomation parsed from cookie was : {"cookie":{"originalMaxAge":null,"expires":null,"httpOnly":true,"path":"/"}} The cas st is missing. I guess the cookie was reset when open the pageB.

I did an experiment to verify it. I deploy application A in the old machine, application B in the other machine. Everything is ok, no matter how did I switch operation on pageA and pageB.

I wonder if connect-cas2 support two web application deployed on a machine.

yuyongyu08 commented 6 years ago

my case deployed on a same PC work well.

fyzwjd commented 6 years ago

Can you share your config? @yuyongyu08