Skip to content

NoMethodError (undefined method `cookie_value' for nil:NilClass) in API only Rails project #292

@KNejad

Description

@KNejad

I'm getting the above error on my API only Rails project.

I think the issue is because we are running an API only Rails App without any cookies, and Impressionist is expecting to be able to retrieve the cookie_value from request.session_options[:id], which is nil for us.

Is there any way to handle this case without requiring cookies? Have I made a mistake here?

If not, would there be any interest in a PR to enable support for API only Rails projects without sessions? If so I'd be happy to implement this. Based on what I've seen it shouldn't be too hard.

This is the full stack for the impressionist part of the error:

impressionist (2.0.0) app/controllers/impressionist_controller.rb:143:in `session_hash'
impressionist (2.0.0) app/controllers/impressionist_controller.rb:60:in `associative_create_statement'
impressionist (2.0.0) app/controllers/impressionist_controller.rb:132:in `direct_create_statement'
impressionist (2.0.0) app/controllers/impressionist_controller.rb:45:in `impressionist_subapp_filter'
impressionist (2.0.0) app/controllers/impressionist_controller.rb:7:in `block in impressionist'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions