Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby on Rails: how can I store additional data in the session for authlogic

I'm using Authlogic to authenticate users.

I understand how to create and use sessions, but want to store an additional id variable in the current_user session created by authlogic.

Can I just do something like this:

session[:authlogic_sess_name] = @extra_id.id

However, I'm not sure what the authlogic session is named though or how to access it.

Thanks!

like image 819
djburdick Avatar asked Oct 29 '25 21:10

djburdick


1 Answers

Why would you not just store the value in the session?

session[:extra] = @extra_id.id

The Authlogic current_user is simply a value in the current session, managed by the Rails stack itself.

like image 67
Toby Hede Avatar answered Oct 31 '25 12:10

Toby Hede