Why isnt the session timeout working when set to SqlServer?

前端 未结 3 1692
花落未央
花落未央 2021-01-05 23:18

I have the line:


3条回答
  •  别那么骄傲
    2021-01-05 23:46

    If you're using SQL Server Express, it's because there is no SQL Server Agent to execute the DeleteExpiredSessions procedure.

    Here is a possible workaround to the problem:

    In the stored procedure that updates the session, I have added SQL from the DeleteExpiredSessions procedure to the update session stored procedure (I can't remember the name) so it checks for old sessions, deletes the old session, and then updates the current sessions. The stored procedure that updates the session runs on every click anyway, so I added two more lines that remove old sessions before the session is updated. This seems to work fine.

提交回复
热议问题