session-state

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

倖福魔咒の 提交于 2019-12-04 12:19:54
问题 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

How to prevent session timeout

假装没事ソ 提交于 2019-12-04 11:28:57
问题 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 回答1: Here is one way: http://weblogs.asp.net/stevewellens/archive/2009/06/09/ah-ah

request.getSession(false) not returning null after calling session.invalidate()

假装没事ソ 提交于 2019-12-04 10:47:50
问题 Shouldn't invalidating a session cause request.getSession(false) to return null? In my logout servlet I call session.invalidate(); and in my login status filter I call request.getSession(false); The call to getSession(false) never returns null but all attributes associated with the session object returned are null. I currently detect if a user is logged out by searching for null attributes but this doesn't seem right. 回答1: I currently detect if a user is logged out by searching for null

Is it necessary to create ASP.NET 4.0 SQL session state database, distinct from existing ASP.NET 2.0 ASPState DB?

假装没事ソ 提交于 2019-12-04 09:05:06
问题 Is the ASP.NET 4.0 SQL session state mechanism backward-compatible with the ASP.NET 2.0 schema for session state, or should/must we create a separate and distinct session state database for our ASP.NET 4.0 apps? I'm leaning towards the latter anyway, but the 2.0 database seems to just work, though I'm wondering if there are any substantive differences between the ASPState database schema / procedures between the 2.0 and 4.0 versions of ASP.NET. Thank you. 回答1: There was no quick answer on

Loses session state in iframe, but not in pop-up window

倖福魔咒の 提交于 2019-12-04 09:00:19
We're developing a web shop, and process payments with a third party UI. We have chosen to show the payment UI inside an iframe inside out check-out page, even though (we now realize), the payment solution provider recommend using a top-level window. Now what happens is that in IE7/IE8, the payment UI loses session state on the first postback (inside the iframe), while in Firefox, it works just fine. We observe that the payment UI is developed using ASP.NET. I was under the impression that as far as the server is concerned, there is no difference between being referenced from an iframe versus

Configure ASP.NET Session State at runtime

混江龙づ霸主 提交于 2019-12-04 08:57:32
问题 We have an ASP.NET web site that uses SQL Server session state. The state is configured in Web.config like: <sessionState mode="SQLServer" sqlConnectionString="data source=TheServer; User ID=TheUser;password=ThePassword;" cookieless="false" timeout="480"/> But there are three environments (development / staging / production). All the other connection strings are configured like: <configuration> <connectionStrings> <add name="Development_Db1" connectionString="..."/> <add name="Production_Db1"

What is the difference between a Cookie and Redis Session store?

喜欢而已 提交于 2019-12-04 05:54:08
I want to share sessions among 2 applications on different nodes; however, I am confused what the difference is between Cookie and Redis session stores; e.g. a cookie session might look like this: rack.session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRiJFN2YxZDMxMGE5YTNhZjc2NGM1NDBk%0AMzdiODQ0MjcyMzk5MzAxY2YyYzdhNDMwOWVkMzhiNWVlMmY2N2QwYzExNg%3D%3D%0A--ec4ec7b5a807c806e02e2811f4a11d05877a7698 In Redis, a session-store, might look like this: rack:session:eb23c0a055e9e6de3b8ad51efd9g6260d647b2e61326e35f5ff59cd490bfb405" However, I am confused how these sessions can be shared. Whereas in a cookie approach, a

When is session created during JSF login?

假装没事ソ 提交于 2019-12-04 05:53:46
In JSF, it seems that sessions are created before a successful login. i.e. simply requesting the login page causes a new session to be created. It seems very wasteful (and vulnerable to DDoS attacks) to create a session for each request received, rather than each successfully logged in user. The code below is pretty generic, but shows the kind of simple scenario I'm referring to. index.xhtml: <html> <body> <h:form id="login"> <h:outputLabel for="username">Username</h:outputLabel> <p:inputText id="username" name="username" value="#{userController.username}"/> <h:outputLabel for="password"

ASP.NET and Sessions - New Browser Instance versus New Browser Window

限于喜欢 提交于 2019-12-04 05:23:32
I'm hoping someone can clarify this behavior for me, and explain how ASP.NET is deciding when to treat something like a new Session. A) In Internet Explorer I load the ASP.NET site in question. It starts a new Session. B) If I go to menu File - New Window... it stays within the same Session. C) If I launch a new instance of Internet Explorer and load the same page it starts a new Session. I'm confused by step C. I'm expecting it to be the same session based on my remote IP. What is IIS / ASP.NET doing to decide that this is a new session? Is it looking at my remote port that the new instance

When is session state initialized in the ASP.NET pipeline

守給你的承諾、 提交于 2019-12-04 03:45:17
I have an IHTTPModule with an event handler for AuthorizeRequest. I would like to access the Session object but it is not yet initialized. Which event should I subscribe to in order to have the session object available as early as possible in the pipeline? You needd HttpApplication.PostAcquireRequestState event - http://msdn.microsoft.com/en-us/library/system.web.httpapplication.postacquirerequeststate.aspx . Also there is a HttpApplication.AcquireRequestState event. Don't forget to check if your handler implements IRequiresSessionState or IReadOnlySessionState, otherwise it will throw an