golem icon indicating copy to clipboard operation
golem copied to clipboard

session sample

Open luisbebop opened this issue 11 years ago • 2 comments

First of all congratulations for this outstanding work. I'm trying to use the session example (https://github.com/trevex/golem_examples/blob/master/example_session.go) but it isnt't working anymore. The validateSession is not finding the session defined by the loginHandler (https://github.com/trevex/golem_examples/blob/master/example_session.go#L23

I've tried to figure out what happened but I haven't get conclusions yet. I have tried with Chrome and Safari.

Any idea?

luisbebop avatar Nov 22 '13 13:11 luisbebop

I just tried the example myself and fixed a return value problem with go1.2 and also reinstalled the gorilla/sessions dependency to make sure it's the newest version. I am not encountering the same error though.

Which version of go are you using? Could you post the compile error as well?

trevex avatar Nov 22 '13 15:11 trevex

I've just discovery what happened. I was accessing the session_example.html through the address http://localhost:8080 and the file https://github.com/trevex/golem_examples/blob/master/public/example_session.html#L6 is configured to 127.0.0.1 So the cookie storage generated a cookie for localhost:8080, but the browser was sending the cookies prepared to 127.0.0.1

Would be better to use in the example html: var conn = new golem.Connection("ws://"+ window.location.host + "/ws", true);

Thanks in advance.

luisbebop avatar Nov 23 '13 01:11 luisbebop