noir-clojure / lib-noir

A set of libraries for ring apps, including stateful sessions.
Eclipse Public License 1.0
483 stars 47 forks source link

losing session on source change #88

Closed keeds closed 10 years ago

keeds commented 10 years ago

Since version 0.6.9, when I change a source file I lose my session when run using "lein ring server". 0.6.8 works as expected

yogthos commented 10 years ago

The only thing that comes to mind is that Ring dependency was bumped up to [ring "1.2.0"] from [ring "1.1.8"]. Could you try and see if moving back to 1.1.8 fixes the issue. If that's the case I would open an issue on ring-clojure.

yogthos commented 10 years ago

Actually, appears that the problem was caused by using the default memory-store from Ring:

(wrap-noir-session
          {:store (or store (memory-store))}) 

It creates its own atom, but looks like when namespaces are reloaded it's lost. I changed it back to using the atom from noir.session and it fixes the issue.

I pushed out a new version of lib-noir [0.7.1] that should fix the problem.

yogthos commented 10 years ago

@keeds could you confirm if the bug is fixed so I can close the issue?

keeds commented 10 years ago

Excellent, that appears to fix the issue. Thanks (again) for the fast response.