I have a signin lightbox that needs to be shown when user is not logged in. The lightbox is completely implemented in javascript, fancybox and uses rails partials for html.
I can see the cookie is set in chrome when logged in, but document.cookie seems to return empty. The reason probably has been explained here
How do I achieve this in javascript / erb.
Handle this in the backend. If you’re doing this with rails, be sure to use and abuse
current_user, because it will be your best friend.Then in your partial, you’re free to have something like this
Rails Sessions, Ruby on Rails Tutorial