Description

For every request w/o a cookie sent by the client, moin creates a new anonymous session. That is fine in principle, but it should not store empty sessions (sessions containing just 'expires') to disk.

Steps to reproduce

  1. enable anonymous sessions
  2. wget <your wiki url> OR curl <your wiki url>

  3. see session file

Example

n/a

Component selection

Details

MoinMoin Version

1.9 development

OS and Version

Python Version

Server Setup

Server Details

Language you are using the wiki in (set in the browser/UserPreferences)

Workaround

N/A, cleanup will remove such sessions eventually but they shouldn't be stored to start with.

Discussion

Usually there should be a trail in the session.

I am not sure if this solves all cases

   1 diff -r 2c025e231b5f MoinMoin/web/session.py
   2 --- a/MoinMoin/web/session.py	Sat Jan 16 07:01:45 2010 +0300
   3 +++ b/MoinMoin/web/session.py	Sat Jan 16 15:41:05 2010 +0100
   4 @@ -202,7 +202,7 @@
   5              # add some info about expiry to the sessions, so we can purge them:
   6              session['expires'] = cookie_expires
   7  
   8 -            if session.should_save:
   9 +            if session.should_save and ('trail' in session and len(session['trail']) > 1 or 'user.id' in session):
  10                  # note: currently, every request of a logged-in user will save
  11                  # the session, even when always requesting same page. As we
  12                  # store the page trail into the session, we would save rather
session.patch

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/MoinSavesEmptySessions (last edited 2010-01-17 21:49:40 by ThomasWaldmann)