Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Reasons why a session can't be saved? Stumped. #193

urbanistica opened this Issue Oct 6, 2010 · 3 comments


None yet
2 participants

I've downloaded and tested the git sample project, and it works fine.

I have to integrate this into an existing project, and so I have some constraints, but I'm trying to line everything up. But, although I can create users using the registration code in my project, I can't save a session. I've replicated the fields in the db, and I'm using them in my project; I've used the same code and the same controller names, and the same models and model names. The main departure here is that the Users table has fields not found in the sample project: I assume this is not a limitation?

I've got the same before filters, but again I have code that calls and saves session values. Is this going to interfere with Authlogic? And, I can see that the form used for the login is sending exactly the same parameters to my project as it does from the sample project pages, to the sample project.

I'm mystified. My test for whether a session user is being found and saved is

def create
@user_session = UserSession.new(params[:user_session])
logger.debug "user session is #{@user_session} with #{@current_user}"
msg = (@user_session.save) ? "success" : "failure"
if request.xhr?
render :update do |page|

And it's not working…

Oh, yeah: rails 2.2.2, OS X 10.6, rubygems v 1.3.3, ruby 1.8.7

ADO commented Nov 6, 2010

Any luck with this?

Some – I am more careful to destroy sessions when users logout, or leave the session, and that helps. Making sure to fetch the user is important.

I still have a problem with a user logged in to FB and my app, then logging out of FB and interacting with the app. I haven't focused on it in a while: when I look at it again I'll try to remember what I changed, and what worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment