session-state

If REST applications are supposed to be stateless, how do you manage sessions?

I'm in need of some clarification. I've been reading about REST, and building RESTful applications. According to wikipedia, REST itself is defined to be Representational State Transfer. I therefore don't understand all this stateless gobbledeygook that everyone keeps spewing. From wikipedia: At any particular time, a client can either ...

How do I preserve state of a gridview between postbacks?

I have a gridview that is populated by drop down lists. I change the text in the cell to the chosen item in the list. When I make a second choice the first one is erased. Any thoughts would be appreciated. Thanks ...

Windows identity getting confused between users

We are observing some strange behaviour in our web server logs where where the Identity of the currently logged in user seems to be getting swapped with another user. I will describe our set up before explaining further. We are running an asp.net web site (v3.5 of the framework) on 2 Windows 2008 web servers and use forms authentication...

Unable to access Session State from class?

I have a Dynamic Data application to which I have added a class for extending EDM. Everything works great, but now I am trying to set an entity property value equal to a value in session state - and its not recognizing the Session command. I'm trying to do something like this: audit.action_by = CStr(Session("person_name")) I think thi...

Rationale Behind IReadOnlySessionState

I just implemented a handler that uses IReadOnlySessionState and was wondering why this marker interface is needed. (I understand that it is needed in order to access Session variables, my question is why is this from a framework designer's perspective) My thinking is that it is so handlers can be as lean as possible, requiring them to...

Where's the best place to store a custom "User" object for the duration of an ASP.NET session?

I have an ASP.NET application that needs to remember some info about a user (and what company they are from) across pages, within a session. I imagine this is a requirement of just about any ASP.NET application of a certain size. I've used a few different approaches over the years. In the past, I've passed around an id in querystring p...

Comparing Viewstate and SessionState

I set ViewState["zzz"] and Session["zzz"] to the same string. When I compare using == I get false. When I do ViewState["zzz"].Equals(Session["zzz"]), I get true. In the debugger, both their values show the same string, and when I do ? ViewState["zzz"] == Session["zzz"] I get false. I thought the ViewState StateBag Item defaults to...

Blackberry on ASP.NET Webforms is losing SessionID

We're having trouble with an existing ASP.NET Webforms app. It's an app that has been running successfully for years; we're adding a Mobile section and Blackberry with Javascript enabled is giving us trouble. We have SessionState turned on, with the SessionID stored in a Cookie. The Blackberry device (tested with both 5.0 and 4.6) is ei...

How to maintain the same session id across multiple web applications in ASP.NET

I have two identical applications setup on IIS on different virtual directories (I have done some workaround to ensure that they both have the same application name). Is there a way to share session id across two asp.net web applications? Since I'm storing the session in StateServer, they should both be getting the same session data, h...

overriding the default session time in ASP.NET and IIS

How can I change the default session time in an ASP.NET website to something user defined - perhaps 1 hr? I assume the default session time is 20 mins.. ...

Maintaining state across site in C# ASP.NET

Hi, I have a website that returns search results from Twitter, written in C# ASP.NET. The search works very well. When the user sees the results I want them to also have a 'Next Page' type hyperlink that will perform the search from the last previous result onwards (using Twitter's next_page data). How can I preserve properties so th...

Problems enabling SessionState in ASP.NET...

Hi, My attempts at enabling SessionState are failing :-( I've added the following page directive to the page: <%@ Page ... EnableSessionState="True" %> And to my web.config file, I've added the following: <system.web> ... <sessionState mode="InProc" cookieless="false" /> <pages enableSessionState="true"> ... <...

Accessing Session in MasterPage load event after a UrlRewrite

Situation: In Web.Config we have CustomErrors turned on with redirectMode="ResponseRewrite". In Page_Load of our MasterPage we access the Session property of the Page. Problem: When an Error occurs on any page the user gets redirected (via Rewrite) to our Error.aspx Page. There in the Page_Load of the MasterPage we access the Sessio...

Deploy ASP.NET application in the same web site as Sharepoint

Hello, I am trying to deploy the Bugtracker.NET tool (http://ifdefined.com/bugtrackernet.html), which is a normal ASP.NET 2.0 application, into the default web site of an IIS which already has Sharepoint installed in it. The OS is Windows Server 2008 R2, IIS 7.5 and Sharepoint Services 3.0. The question is that when I execute the appli...

Warning: session_start() failed: No such file or directory

I'm trying to install berta (v 0.6.3b) a cms. and I get this error. The error seems to happen on line 75 of class.bertasecurity.php (view source code) What is wrong and how can I fix it? Thank you so much! Answer I added this to the class.bertasecurity.php file session_save_path($_SERVER['DOCUMENT_ROOT'] . '/randomfolder/sessions'); ...

Invalid object name 'ASPState.dbo.ASPStateTempApplications' - Exception after renaming the ASPState Database.

I have created new session database using the command (aspnet_regsql.exe -S -E -ssadd -sstype p) and it created DB called ASPState. Then I renamed it to something like E_ASPStateDB. I have configured the correct DB name in the sessionState connection string. But still it throws the exception Invalid object name 'ASPState.dbo.ASPStateTe...

How to destroy a session of another than current user in asp.net

Hello, I'm using asp.net 4.0 with asp.net MVC 2.0 and the asp.net membership provider. I need to terminate a the user session before I delete it. Otherwise if the user is still authenticated the next time it will visit a page null reference exceptions will occur when trying to access the user data and profile. I get the Session.Abando...

Session state on a network load balance scenario.

Hi, We've currently got the current server set up for a site: Server 1: Admin System & Database Server 2: Public site Server 3: Public Site Server 2 and 3 are managed using the Windows Network Load Balancing system. They are both running copies of the public site code. The sites rely heavily on sessions because they work with user...

How to modify MachineKey for Session State Server?

I'm trying to implement a SessionState server to allow multiple web servers to share the same state. At first this will be the different dev machines, and later it'll be the different web servers in the web farm. So far, I'm making good progress I think, but one of the requirements has me confused. In order to implement this, I need to ...

Problem with cookiemode and uri-encoded cookies

Hi. In a webapplication I use cookies for authentication. But when the browser or device accesing the webapp does only support uri-encrypted cookies, I get a problem. The normal links are updated by the browser itself, but i have some ajax functions that need authentication too. How can i insert the uri-encoded authentication cookie int...