session-state

what's differences between “forms timeout”, “membership userIsOnlineTimeWindow” and “sessionState timeout”

主宰稳场 提交于 2019-12-03 11:13:50
What is the difference between these lines of code: <forms timeout="5" /> <membership userIsOnlineTimeWindow="5" /> <sessionState timeout="5" /> Thanks a lot. Forms ( FormsAuthention ) are used for authentication and when it times out it will logout user. You can 'prevent' timeout by setting SlidingExpiration property to 'true' and it will renew forms ticket on user activity (read request to asp) if needed. This will keep user logged on while he is 'active' on your site. Membership is used for user validation and userIsOnlineTimeWindow is there to help you track user activity so when it runs

Sharing Session State between different .NET Versions using State Server

孤街醉人 提交于 2019-12-03 10:32:29
Background We have one website running on IIS 6 (Win2003 Server) using .NET 3.5: site1.mysite.local We have a second website running on IIS 7 (Win2008 Server) using .NET 4.0: site2.mysite.local On each site, the web.config contains the StateServer and the same machineKey: <sessionState mode="StateServer" stateConnectionString="tcpip=STATESRV01:42424" /> <machineKey decryptionKey="EDCDA6DF458176504BBCC720B4E29348E252E652591179E2" validationKey="CC482ED6B5D3569819B3C8F07AC3FA855B2FED7F0130F55D8405597C796457A2F5162D35C69B61F257DB5EFE6BC4F6CEBDD23A4112C4519F55185CB5EB3DFE61"/> We also have a

ASP.NET MVC Session State

笑着哭i 提交于 2019-12-03 09:51:19
问题 I am currently trying to create an upload control with progress bar in MVC using jquery. I keep running into a problem however in that mvc doesn't work in parallel threads? When I upload a file and show the progress during upload from JS performed through several callbacks to server, I am trying to get information about current upload state but answer from server comes back only when the file has been uploaded. Do you know of any way to get session state queries in MVC constantly or when

What are the different approaches for Java EE session replication?

China☆狼群 提交于 2019-12-03 09:34:31
问题 I am working on a project that requires really high availability and my team is currently working on upgrading some infra-structure and software for a future release. One of the features we would like to enable is to have session replication across not only different servers, but ideally across different sites (geographically spread). Is that possible? What are the approaches? For what I have seen so far, to enable session replication, the usual vendor approaches are either one of these:

Session.Clear() vs. Session.RemoveAll()

烈酒焚心 提交于 2019-12-03 09:19:40
Is there a difference between Session.Clear() and Session.RemoveAll() ? The descriptions and documentation pages seem to say exactly the same thing, but I am assuming there must be some reason for creating two functions, am I right? To be save you can always just call them all like so.... Session.Clear() Session.Abandon() Session.RemoveAll() VB.NET example, I am sure all you need to do is place the ; at the end of each of them. This did the trick for me as I had some problems with my Session before where they were not removed. Absolutely the same. RemoveAll calls Clear internally. From

How to retrieve a generic list from session?

我与影子孤独终老i 提交于 2019-12-03 07:48:21
I have a list that I put in session: Session.Add("SessionList", mylist); How to retrieve it back from the session? var list = Session["SessionList"] as List<whatevertypeYouUsed>; if (list != null){ // blah... } I prefer to use the as keyword since there is no 100% guarantee that the Session will contain the list (due to application pool refresh, website being restarted, etc). Gives you that extra bit of defence to avoid a NullReferenceException . Try var myList = (List<WhateverTypeItIs>)Session["SessionList"]; liek this... var list = Session["SessionList"] as List<whateveritis>; or you can

Securely implementing session state and 'keep me logged in' feature

柔情痞子 提交于 2019-12-03 07:43:56
问题 I would like to improve security on a current application regarding session management and I want the users to be logged in until they explicitly logout. How does one implement that securely? Keep session information in database, like sessionid, ip, useragent? Please provide the requirements, possibly a database layout, do's and don'ts, tips and tricks. Note: I know frameworks like asp.NET, rails, codeigniter, etc... already take care of that, but this is not an option. Actually it for a

Getting ASP.NET Cookieless Sessions and JQuery AJAX to play together nicely

China☆狼群 提交于 2019-12-03 07:39:56
I have a web site that uses JQuery AJAX. With this JQuery code $.post("/ajax/getsomedata.aspx", {'id': id }, function(data) { dosomething(data); } ); When I run this with cookieless="false" , id shows up in Request.Form . When I set cookieless="true" , id is no longer in Request.Form . UPDATE, What I did I added a call to Response.ApplyAppPathModifier() to preserve the data and avoid an automatic redirect. I am excepting **Diago(( and deleting my own because his references give some insite into what's going on. I like to idea of the seperate domain, but I can't do that here. Here's the updated

Using cookies to store session in ASP MVC

筅森魡賤 提交于 2019-12-03 07:28:09
问题 Storing the entire session in a cookie has been standard in Rails for the last few years - is there an easy way to achieve something similar with ASP MVC? By default, anything in Session / TempData is stored in memory on the server. In web.config this can be changed to an SQL Store / server-side cache. I'd like to be able to have these objects persisted in a cookie. It looks like I could implement a custom Session-State Store Provider. Is there a simpler approach? 回答1: yes, implement a custom

How to prevent session timeout

ぃ、小莉子 提交于 2019-12-03 07:19:11
I know this is probably an easy question for most of you guys. But my problem is that my server host empty their session pools every minute. So how do I get my users to stay logged in longer than one minute? I've heard that I could use SessionStates, but I haven't found any guides on the net that's easy to use for a newbie like me. Also I've heard about doing it with cookies. How? I'm working with C# and .Net Steve Wellens Here is one way: http://weblogs.asp.net/stevewellens/archive/2009/06/09/ah-ah-ah-ah-staying-alive-staying-alive.aspx Sometimes you want your web page to 'stay alive'. That