1

In our project we give the users points for every day they visit the site.

The issue is that the user doesn't always log in in an explicit way (e.g. submitting login form), but often when he comes back he's logged in thanks to the cookie session id set by Django and we can't recognize his login in any way.

How can I check if the user has logged in this way?

4

1 回答 1

3

我会在中间件中做到这一点。在配置文件或会话中有一个属性,它记录了用户最后一次看到的日期,并在中间件中检查它是否是今天:如果是,则奖励积分并更新字段。

于 2013-06-09T14:35:40.953 回答