top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How much data we can store in a session object in servlet ?

+1 vote
75 views
How much data we can store in a session object in servlet ?
posted Oct 22, 2015 by Shyam

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Any amount of data can be stored there because the session is kept on the server side.

The only limitation is sessionId length, which shouldn't exceed ~4000 bytes - this limitation is implied by HTTP header length limitation to 4Kb since sessionId may be stored in the cookie or encoded in URL (using "URL rewriting") and the cookie specification says the size of cookie as well as HTTP request (e.g. GET /document.html ) cannot be longer then 4kb.

answer Oct 23, 2015 by Karthick.c
...