ASP.NET Session Timeout Testing

2019-01-31 15:41发布

I'm a doing some blackbox testing of a ASP.Net website and I need to test different session timeout scenarios.

I'm not sure they fully encapsulated session timeouts. Other then leaving a page open for 20 minutes is there an easier way to force a session timeout?

10条回答
我命由我不由天
2楼-- · 2019-01-31 16:13

You can change the timeout in your webconfig

 <authentication mode="Forms">
      <forms timeout="10" protection="All" slidingExpiration="true" loginUrl="~/login.aspx" cookieless="UseCookies"/>
 </authentication>
查看更多
我想做一个坏孩纸
3楼-- · 2019-01-31 16:21

Recycle the app pool on the server.

查看更多
等我变得足够好
4楼-- · 2019-01-31 16:23

Bounce the AppPool and session will be lost.

if you don't have direct IIS access, you can open and save Web.Config to do the same thing (Don't use notepad, it screws up the encoding).

查看更多
Ridiculous、
5楼-- · 2019-01-31 16:24

Make a shorter timeout.

查看更多
做自己的国王
6楼-- · 2019-01-31 16:27

The easiest way would be to open the page in two different tab and logout at other tab would automatically expire session in first tab. Most of the browsers share session across the tab. So i find it very easy without modifying anything in web.config. This way you could test even if a particular feature is not handling redirect to login when session expires.

查看更多
看我几分像从前
7楼-- · 2019-01-31 16:28

If you are storing your session information in a cookie, you could try deleting your cookies.

查看更多
登录 后发表回答