mrniko / netty-socketio

Socket.IO server implemented on Java. Realtime java framework
Apache License 2.0
6.82k stars 1.65k forks source link

Can you set the delay time of session ID stored in cookies? #672

Open zhoulinyun opened 5 years ago

zhoulinyun commented 5 years ago

Can you set the delay time of session ID stored in cookies?

zhoulinyun commented 5 years ago

Is anybody there ? Is the problem too simple?

hungthuanmk commented 5 years ago

What do you mean "delay"? You can use setTimeout in JS for setting cookie after timeout, or just need to include "expires" or "max-age" field to automatically kill the cookie after a specific time

zhoulinyun commented 5 years ago

I'm so sorry! It should be the expiration time.Because our web page is hung under another different domain name page, that is, the cookie set by the front-end JS (key= "io") and the cookie (key= "io") obtained by netty-socketio are not under the same domain name, the cookie set by the front-end JS is useless.

zhoulinyun commented 5 years ago

Do the back end have to change the netty-socketio source code? I would like to ask if it can be solved by inheriting the netty-socketio source code and so on.

hungthuanmk commented 5 years ago

Why don't you let backend send setting cookie request to JS?