asp.net - Handler with IRequiresSessionState does not extend session timeout -


i have handler, this, using irequiressessionstate:

public class myhandler : ihttphandler, irequiressessionstate {   // code } 

in code, able read , set session values. check ensure caller logged in. works fine.

the web site uses forms authentication, in web.config, have this:

<authentication mode="forms">    <forms loginurl="login.aspx" timeout="10" slidingexpiration="true"></forms> </authentication> 

the problem ajax calls client server code myhandler not extend life of session!

so if user busy sending , receiving data server, time out 10 minutes after last full page load.

in handler, i've tried changing value session on each call, not extends time out.

any suggestions?

finally got solution this... sort of.

i abandoned trying handler job, , instead called normal aspx page. in page, removed html code, , used response.write(...) send json wanted. however, that, session not being extended!

i realized in prerender event, used response.clearheaders(). problem. turns out forms authentication system updating session ticket cookie when needed, adding headers before code running. when cleared headers, erasing new cookie before sent browser.

so, if having problems sessions not being extended, check make sure code not using clearheaders()!


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -