954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

sinatra application - how to store very large cahe data? in sessions?

Hello,

I use Ruby with Sinatra in my application and I need to store a big data (exceeding 4K) in my session or somewhere secude on the server because I do some API calls and I refer to that data very often and that's why I need it stored.
The problem is Sinatra dropped my session content because of exceeding 4K data:

<strong>Warning! Rack::Session::Cookie data size exceeds 4K. Content dropped.</strong>


I don't know what to do:

- is there a way of enlarging the maximum capacity of session cookie? although I don't want to get huge cookies.
- is there another way of keeping the data fast and secure maybe on THE SERVER instead of cookie-based session? (sqlite? how?)

I hope I have beed clear on my post. Thanks for reading, I would really apreciate any help... it isvery critical to me.

Clawsy
Posting Whiz in Training
225 posts since Feb 2008
Reputation Points: 11
Solved Threads: 7
 

Got it finally:
Do not write:

enable :sessions

Write:

use Rack::Session::Pool


instead.

:)

Clawsy
Posting Whiz in Training
225 posts since Feb 2008
Reputation Points: 11
Solved Threads: 7
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: