I'm storing an object in hash which is in session object like this :

```
    hash_key = ImportantData.new
    hash_key.test_id = params[:test_id]
    hash_key.user_id = params[:user_id]

    session[:important_data] ||= {}
    session[:important_data][hash_key] = nil

```

And then I print this map `session[:important_data][hash_key]` in my other controller and try to check whether the object is in there or not like this :

```
hash_key = ImportantData.new
hash_key.schedule_id = @test.id
hash_key.user_id = @user.id

in_hash = session[:important_data].has_key?(hash_key) unless session[:important_data].nil?

```

`in_hash` is always false to me, what am I doing wrong? and is there a better way to do this?