1,105,229 Community Members

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

Member Avatar
Clawsy
Posting Whiz in Training
225 posts since Feb 2008
Reputation Points: 1 [?]
Q&As Helped to Solve: 7 [?]
Skill Endorsements: 0 [?]
 
0
 

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:

[B]Warning! Rack::Session::Cookie data size exceeds 4K. Content dropped.[/B]

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 is very critical to me.

Member Avatar
Clawsy
Posting Whiz in Training
225 posts since Feb 2008
Reputation Points: 1 [?]
Q&As Helped to Solve: 7 [?]
Skill Endorsements: 0 [?]
 
1
 

Got it finally:
Do not write:

enable :sessions

Write:

use Rack::Session::Pool

instead.

:)

Question Self-Answered as of 3 Years Ago
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: