session-state

How to avoid ASP.NET SqlServer session to interfer with the ambient Transaction-Per-Request?

Hi, I am trying to use a transaction scope in a transaction-per-request pattern. So I have a http module that do (simplified): private void Application_BeginRequest(object sender, EventArgs e) { var scope = new TransactionScope(TransactionScopeOption.RequiresNew); PutScopeInHttpContext(scope); } private void Application_EndReq...

How to detect a WCF session crash before calling a contract method?

I am using a session mode for my WCF service. The problem is the following: if session is broken and no longer exists, client can't know it before calling a contract. For example, if the service has been restarted, the client's session id is invalid, because that session has been closed on the server side. I check the channel state be...

Maintaining the session even after the browser is closed

Hello, Could anyone tell how to maintain a session (in PHP) so that the session contains are preserved and are accessible even after the browser is restarted. In general a session expires with the closing of a browser, but I want the session NOT TO BE CLOSED so that the session data's can be accessed the next time the browser is used. ...

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

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 substant...

stuck with enable session state

hi i have an application wherein i am accessing the Session object in the CommonCode.cs file that resides in the App_Code folder. But when the session object is accessed the application throws me an error: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. ...

Is my singleton class unnecessary in my custom ASP.NET SessionStateStoreProvider?

I have written a custom SessionStoreProvider class that inherits from the SessionStateStoreProviderBase. I have a class called SessionStore that serves a a Data Access Layer for the database I am using as the backend to store the session data. I've created a singleton instance property like below public static SessionStore Instance ...

Domain entities into (ASP.NET) Session, or better some kind of DTOs?

Currently we put domain objects/entities into our ASP.NET sessions. Now we considering moving from InProc sessions to state server. This requires that all objects inside session are serializable. Instead to annotate all objects with the [Serializable] attribute, we thought about creating custom-session objects (DTO Session Objects?), w...

Is it possible to detect ASP Session State Type from code?

I'm trying to track down a problem on our test environment. Previously it was set to use InProc Session State Type, but I've added in the SQLServer type for one specific Web App. I did this because we use the SQLServer type in our production environment and I want our test env to match as closely as possible. However, after changing i...

ASP.NET - Manual authentication system

Hello all, Wer'e developing an ASP.NET C# application, which will contain an authentication system that authenticates users in multiple levels (user, admin, super-admin, etc.). Our idea is NOT to use the built in ASP.NET forms authentication feature. Our plan is to create a whole 'new' system for it- based on the Session object, and SQ...

How does this Singleton-like web class persists session data, even though session is not updated in the property setters?

Ok, I've got this singleton-like web class which uses session to maintain state. I initially thought I was going to have to manipulate the session variables on each "set" so that the new values were updated in the session. However I tried using it as-is, and somehow, it remembers state. For example, if run this code on one page: User...

Changing expiry on ASP.NET's Session State cookie

I'm using ASP.NET Session State to keep track of logged in users on my site. However, one problem I'm running into is that by default ASP.NET session cookies are set to expire when the browser closes. I've tried setting my own ASP.NET_SessionId cookie and modifying the cookie's expiry using something similar to the following code: R...

How to Maintain per-Client State in a WCF Service?

I've created a WCF service in which I would like it to maintain state between calls from the client. I figured the easiest way to do this was to add this attribute to the service: [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)] since this is supposed to keep a separate service alive for each client over the li...

What is the difference between Session.Abandon() and Session.Clear() in ASP.Net?

What is the difference between Session.Abandon() and Session.Clear() in ASP.Net? ...

Does http and https will share the same sessions

I am building a web application and I need to know whether I can share the Same session or not between http or https? ...

XSS to change ASP.NET session state

Hello! I am developing the application that stores current user and user's role to session state (System.Web.SessionState.HttpSessionState Page.Session). if (Session["username"] == null) Session.Add("username", User.Identity.Name); if (Session["isAdministrator"] == null) Session.Add("isAdministra...

Facebook and a stateless server

I am making a Facebook application, I want to have a stateless server.The Facebook connect requests are from the server side. So when Facebook gives me a session which has to be maintained at the server this way my server won't be stateless. When I'll load balance I can't have a simple load balancer instead it would need to know which ...

storing session data in mysql using php is not retrieving the data properly from the tables.

I have a problem retrieving some data from the $_SESSION using php and mysql. I've commented out the line in php.ini that tells the server to use the "file" to store the session info so my database will be used. I have a class that I use to write the information to the database and its working fine. When the user passes their credenti...

Facebook bottom bar state

What's the best way to keep state in a bottom bar that sticks to the UI, even when different pages are navigated to? Let's say I was programming Facebook and wanted to keep all open conversations the same, etc with the most efficiency. I could use something like jixedbar (is there a better solution?) for the bar, but not sure how to keep...

Manage sessions on different tomcat instances

Hi I am having scenario that I am using 4 tomcat instances on our server.When user login then suppose it is connected to tomcat-1 so we stored all session values in tomcat-1.Then we are processing paypal.After paypal processing user is get diverted to another tomcat say tomcat-2.So there are no values in session for this user.And I am fa...

Asp.Net sharing session across multiple web applications?

I have to share session data between two different Asp.Net Application. The deployment of web apps are as shown below. WebSite --WebApp1 --WebApp2 I have to use same Session data between WebApp1 and WebApp2. Also WebApp1 and WebApp2 both share the same Domain(www.WebSite.com) and AppPool What is the easiest way to make these...