Authlogic and Sessions

trying out Authlogic for the first time (joined the mail list but
apparently the first message is moderated and it’s been hours)…

created db sessions but when I log in, no entry is added to sessions db

Maybe it’s because my ‘user’ model is named ‘member’ and thus I
substituted /user/member/ and /User/Member/ but I wouldn’t think so.

I can login and save passwords but cannot get value from
‘current_member’ or any session variables either.

Should I be creating a member_sessions table in the db or does the
standard Rails sessions table handle this function? I ask because it is
empty.

Craig


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

No, you do not need to create a model named member. User is sufficient.
But you have create user_session model a user_sessions controller.

Try doing exactly as said in this-
http://github.com/binarylogic/authlogic_example/

Let us know if you are facing problems still.

On Thu, Jan 21, 2010 at 8:00 PM, Craig W. [email protected]
wrote:

believed to be clean.


Satyajit

I found ryanb’s railscast video helpful too:
http://railscasts.com/episodes/160-authlogic

Hello.

Try adding this line to config/environment.rb in config block:

config.action_controller.session_store = :active_record_store

On Thu, 2010-01-21 at 23:51 -0800, Ugis Ozols wrote:

Hello.

Try adding this line to config/environment.rb in config block:

config.action_controller.session_store = :active_record_store


yes, this was needed. I think I expected that this was going to be added
automatically when I ran ‘rake db:sessions:create’ command but now at
least it is adding sessions to the sessions table.

Craig


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

On Fri, 2010-01-22 at 05:44 -0700, Craig W. wrote:

On Thu, 2010-01-21 at 23:51 -0800, Ugis Ozols wrote:

Hello.

Try adding this line to config/environment.rb in config block:

config.action_controller.session_store = :active_record_store


yes, this was needed. I think I expected that this was going to be added
automatically when I ran ‘rake db:sessions:create’ command but now at
least it is adding sessions to the sessions table.


my questions are still not coming out on the authlogic list…

Each link I touch on my web site creates an identical session record in
sessions table… (identical session_id and data columns)

and if I don’t disable ‘protect_from_forgery’, I get
InvalidAuthenticityToken error upon login.

Perhaps this is caused by my using ‘Member’ instead of ‘User’ and
‘MemberSessions’ instead of ‘UserSessions’ throughout but I wouldn’t
think so.

Something in my sessions is not working correctly

also, FTR… I found ‘config.action_controller.session_store
= :active_record_store’ commented out in
config/initializers/session_store.rb and uncommented that one and
commented out the added entry in config/environment.rb.

Craig


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

On Fri, 2010-01-22 at 09:36 -0700, Craig W. wrote:

least it is adding sessions to the sessions table.
‘MemberSessions’ instead of ‘UserSessions’ throughout but I wouldn’t
think so.

Something in my sessions is not working correctly

also, FTR… I found ‘config.action_controller.session_store
= :active_record_store’ commented out in
config/initializers/session_store.rb and uncommented that one and
commented out the added entry in config/environment.rb.


FTR

Had to close all instances of the browser and reload… that was simple
enough but a lot of time wasted figuring it out. Leaving the footsteps
in case anyone else has this issue.

Craig


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs