small medium large xlarge

Generic-user-small
08 Sep 2010, 08:46
Jaques Foucry (2 posts)

Hello,

I use rails 2.3.8 with MySQL5 on a Mac (10.6.4) and I have a problem with user connexion. Each time I try to connect I am always redirect to… login. The session seems ok in the DB. | id | session_id
| 5 | 82a08a581f29a1cd89ab2e67a58291f3 |

And the user exist in the DB too | id | name | | 1 | test |

I saw a explanation in admin_controller.rb (a mistake form another reader [session :user_id] = :user.id should be [session :user_id] = user.id) but my admin_controller.rb is ok.

I am a newbie but session_id should be user.id, in this case 1 no ?

Thanks in advance, Jacques Foucry

Generic-user-small
08 Sep 2010, 09:42
Jaques Foucry (2 posts)

Hello again,

I’d check again and again my code and I found the problem. It was in Application_Controller.rb, in the authenticate methode

find_by_id(session[:user.id]) instead of find_by_id(session[:user_id])

Sorry, and thanks to all who read me.

Regards, jacques Foucry

You must be logged in to comment