I've got vanilla django project with app called 'app' . It has views.py and middleweres.py.

```
#views.py
from django.http.response import HttpResponse

def home(request):
    return HttpResponse('')

#settings.py

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'app.middlewares.M',
)

#middlewares.py
class M(object):
    def process_request(self, request):
        request.session['a']='a'

```

Django adds a row to session table in db on every request. Why?

UPD: I'm still confused. I've made a github project for that question: <https://github.com/vinograd19/django-session-problem/>
You can find out my code there and run it on your machine