Skip to content

Fallback to cookie session store when mongo session store is not needed #44

@drgcms

Description

@drgcms

Hi!

I've been thinking about this for quite some time.

At first I was annoyed that whenever crawlers visit my web pages, they do not retain cookies. So every visit to site made a write into session store collection, which was never used again. I ended up making a batch job, which was deleting from session store all document which had created_at value equal to updated_at value. Later I found out that setting session to nil avoids this behavior, so this problem doesn't exist anymore.

Then I have one idea. I really need mongo session store only when users are logged in. Data required for guest user is so small that it can easily be stored to Rails cookie store. Even users, which are not CMS editors, don't need session data stored into mongo session store. On positive side this would make one read and write less to MongoDB per visit and can have huge impact on speed optimized web sites.

My question or proposal for an update is? Is there a way to fallback to cookie session store, when mongo session store is not required and how to do it?

Thanks and stay healty
Damjan Rems

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