NoamB/sorcery — Issue #148: Beginner needs help please 
Author: fifoooo
Created: 2011-11-11 16:05:45+00:00
State: open

HI there
I try to use Sorcery the basic way using only Simple Password Authentication with remember_me

gem is there
migration is ok ; users table is there.
I've been able to sign up . It creates a row in database.

Now when i try to login with this user here's what happen :

class SessionsController < ApplicationController
def new
end

def create
user = login(params[:username], params[:password], params[:remember_me])
if user
redirect_to root_url, :notice => "Logged in!"
else
redirect_to root_url, :alert => "Email or password was invalid."
end
end
....

In debug mode, afetr calling login function it says current_user = # and same for user. So toi me it looks fine

BUT

Then my home page loads (root_url) and :
#part of my applcation.html.erb :

<% if current_user %> # here debug says current_user = nil
Logged in as <%= current_user.email %>.
<%= link_to "Log out", logout_path %>
<% else %>
<%= link_to "Sign up", signup_path %> or
<%= link_to "Log in", login_path %>.
<% end %>

I must be missing something but i really don't know what.
Only hint : seems like notices and alerts from Flash have the same problem. values looks ok in the first part but they are = nil in application_controller.

If someone can help me ....

Greetings

Phiiippe