Search code examples
gocloud9-idemartinigorilla

Gorilla/Martini sessions not working in Cloud9 IDE environment


I've been experimenting with Go web application development in the Cloud9 IDE environment. So far I've had no success with using Gorilla sessions (which are also the underlying mechanism for sessions in the Martini web framework). However, the exact same code DOES work successfully in any other environment.

To reproduce the issue, you can cut-n-paste the exact "Hello World" style example app from the Martini sessions add-on (see here). In this simple example, the "/set" URL places a value on the session, and the "/get" URL displays the value that was previously set.

In a Cloud9 IDE project, calling the "/get" URL logs the following to the console:

[martini] [sessions] ERROR! illegal base64 data at input byte 155

I get similar results when trying to test Gorilla directly. However, when running any of this exact same source code, unmodified, in my local environment (or in a Nitrous.IO cloud environment), it works just fine.

Is anyone doing Go web development on Cloud9, and have any insights into this issue? Thanks!


Solution

  • It turned out that our (Cloud9) application proxy does not encode all cookies properly. We have a fix for that, which should go live very soon.