#1 2016-02-29 10:26:02

Chaa
Member
Registered: 2011-03-26
Posts: 245

Cookie grows in MVC Web app

Cookie values accumulated during a working with web app,
and amount of transmitted data grows.
There is about 20 KB of cookie data instead of 60 bytes.

Is there any way to make it smaller?

mormot_cookie.png

Offline

#2 2016-02-29 12:45:23

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,359
Website

Re: Cookie grows in MVC Web app

There should be a single cookie per session.
I guess you may create a cookie per request...

Offline

#3 2016-02-29 13:07:15

Chaa
Member
Registered: 2011-03-26
Posts: 245

Re: Cookie grows in MVC Web app

ab wrote:

There should be a single cookie per session.

Yes, it's single per session.
But after server restart, new session created. And old session cookie does not deleted.
So cookie values accumulated.

Offline

#4 2016-02-29 13:16:19

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,359
Website

Re: Cookie grows in MVC Web app

AFAIR the cookie should expire at session ending (see Expires/Max-Age) column.
If you restart your browser, the cookies should be deleted.

Offline

#5 2016-02-29 15:00:08

Chaa
Member
Registered: 2011-03-26
Posts: 245

Re: Cookie grows in MVC Web app

Sorry for useless questions. It's a Google Chrome feature.

https://bugs.chromium.org/p/chromium/is … ?id=128513

Offline

#6 2016-02-29 15:35:44

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,359
Website

Re: Cookie grows in MVC Web app

No problem.
I was not aware of this "feature".
sad

So we may have to explicitly unset the cookie when the user logout, or an invalid mORMot* cookie is sent...
Any idea?

Offline

#7 2016-03-01 05:38:08

Chaa
Member
Registered: 2011-03-26
Posts: 245

Re: Cookie grows in MVC Web app

I use CurrentSession.Finalize and Chrome delete cookie values, as expected.

Only after server restarted cookie values not deleted.

So I guess it's not an issue on production server.

Offline

Board footer

Powered by FluxBB