Please note I am a newb to Go lang, Go net/http and Gorilla Session, and somewhat to web development in general,
and I suspect this is a newb question. I hope so, and hope you can point me in the right direction (without a lot of effort from you.)
I am attempting to update a session within a server call that originates from a JavaScript JQuery POST within a page, however repeat/subsequent page calls get a different session (I suspect) from the one I updated (and saved.) I am using Chrome browser to test, and log.Printf to display values. My debugging log statements show a different session is generated each time for this call. (More precisely the %p print value of the struct is different, I'm not sure if I am off base with my assumption it is a different session.) Interestingly it does contain the values of the "page session", so maybe it is more my Save isn't saving.
Initially the session cookie was NOT sent on the JavaScript JQuery POST, but I've resolved that using JQuery AJAX with xhrFields: {withCredentials: true}, ... however the session still appears to be different / "not saving".
As I continue to dig in with Chrome Developer tools (network tools) I do NOT see an updated cookie being sent back with the AJAX call.
Assuming I am storing sessions in the cookie itself (I'm using the CookieStore store implementation), is the fact that my save does not appear to update the cookie imply something wrong with the struct I saved into Values, or something?
Even if I should perhaps be using a different (file based) store, should I be seeing an updated cookie here?
I'm posting here 'cos I suspect folks new to Gorilla Session might've hit the same problem, and I'd appreciate pointers. Thanks in advance.
BTW: Unrelated but when I pass the session key from the environment and then failed to set it in the environment things failed silently. Should the NewCookieStore method reject an empty/missing string, maybe panic'ing? It would've saved me a lot of head scratching. :-)
regards,
Adam