Apr 06, 2016, 9:21 AM
Session problem in mvc
Hi all
Well, I have the following problem:
I have an app with a tipical login and I save the session vars in server with HttpContext (HttpContext.Current.Session["user"]...).
Client saves nothing of session.
The problem comes when some user opens a browser ("browser-window-1") and log in, then open other tab/window of the browser ("browser-window-2"), log out and log in with other credentials. Now, "browser-window-1" will work with the second session and rendered elements from the first.
My first idea to solve it it's sending a token in each directevent, adding it as param but:
I have searched in Google and found a post about using cookies. I tryed it but are shared in both browser-tabs too.
Now I am thinking about updating the cookie value with each ajaxrequest to send a value stored in JS, but seems too much work too....
Close "browser-window-1" or redirect to "login" view its my goal if different session is in server.
Finally my question is: Is there a "easy" solution with ext.net, or could you provide me a post with a solution?
Sorry if there is a similar post that I haven't seen and thanks in advance.
Well, I have the following problem:
I have an app with a tipical login and I save the session vars in server with HttpContext (HttpContext.Current.Session["user"]...).
Client saves nothing of session.
The problem comes when some user opens a browser ("browser-window-1") and log in, then open other tab/window of the browser ("browser-window-2"), log out and log in with other credentials. Now, "browser-window-1" will work with the second session and rendered elements from the first.
My first idea to solve it it's sending a token in each directevent, adding it as param but:
- My app has more than 3000 direct events so....
- I have no idea how to create a global method to check a token from directevents in each request in server.
I have searched in Google and found a post about using cookies. I tryed it but are shared in both browser-tabs too.
Now I am thinking about updating the cookie value with each ajaxrequest to send a value stored in JS, but seems too much work too....
Close "browser-window-1" or redirect to "login" view its my goal if different session is in server.
Finally my question is: Is there a "easy" solution with ext.net, or could you provide me a post with a solution?
Sorry if there is a similar post that I haven't seen and thanks in advance.
Last edited by VilcheS; Apr 06, 2016 at 9:40 AM.