Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to reset ASP.Net sessions state timeout with ajax request
    primarykey
    data
    text
    <p>I am working on an ASP.Net Full-Ajax site. Because all operations have doing by Ajax requests, any postback request will not send to server.In other hand I have a javascript timer that send an ajax request to check sessions and if it expired redirect user to login page.</p> <p>Problem is here: When user is working on page for 20 minutes and all operations will do with ajax requests after 20 minutes its session expired and user will redirect to login page (by that javascript timer) exactly during working with page. So I need to refresh its session state with ajax request. But how ?How can I do that to reset sessions state timeout by an ajax request!?!!</p> <p>Depend on my Google search results, I can not be preform by ajax request because SessionId store in client as a cookie and to update it need to preform a post back request :(</p> <p><strong>Note</strong> : Session state is set on <code>InProc</code> mode with <code>timeout = 20</code></p> <p>Sorry about my bad English syntax, I am new in English</p> <p>Regards, Foroughi</p> <p><strong>UPDATE</strong> : Does an ajax request update sessions state timeout?!!</p> <p><strong>UPDATE</strong> : When my user login to site I set a session like this : </p> <pre><code>Session["UserId"] = UserObject.Id; </code></pre> <p>and in all my page I use some web method to preform operation like this :</p> <pre><code>[WebMethod] public static Opr1 (Paramethers...) { //Question is here , how can i update UserId session to prevent to expire,how can i update it //execute my codes to preform Opr1 } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload