asp.net-session

Maintain a user's session state in an ASP.NET MVC app hosted on a web farm

What is the best way to maintain a user's session state in an ASP.NET MVC app hosted on a web farm? Out application currently uses the standard ASP.NET session on IIS 6.0 but we want to move the app to a web farm environment. I have read that we can use SQL Server session state for our application but I just want to know if anybody was...

How can I set the Secure flag on an ASP.NET Session Cookie?

How can I set the Secure flag on an ASP.NET Session Cookie, so that it will only be transmitted over HTTPS and never over plain HTTP? ...

ASP.Net Error - Unable to cast object of type 'System.String' to type 'System.Data.DataTable'.

I get the below error Unable to cast object of type 'System.String' to type 'System.Data.DataTable'. This is the code I'm using Dim str As String = String.Empty If (Session("Brief") IsNot Nothing) Then Dim dt As DataTable = Session("Brief") If (dt.Rows.Count > 0) Then For Each dr As DataRow In dt.Rows...

Classic ASP to ASP.Net one-off session data copy

We have an extensive classic ASP site, and we're looking to upgrade to ASP .Net (most probably the latest version). Obviously upgrading all the pages at once would be a leviathan task, so we're only looking to write new pages (and page rewrites) in ASP .Net at first. There are two obstacles to doing so: I have no idea how to access cl...

Storing values in asp.net session using jquery

Hi All, How to store values in the session using jquery. I am using the following code var Link = '<%=Session["Link"]%>'; to get data from session. How to do the reverse process. Problem: I need this in my master page. so i cant use .ajax{}. Geetha ...

How do I access a asp.net session variable from APP_CODE??

I have seen lots of posts here and elsewhere stating that one can access session variables from app_code. I want to access an already created session. this code errors out because of a null exception. string myFile = HttpContext.Current.Session["UploadedFile"]; this creates a null session variable. System.Web.SessionState.HttpSessio...

Is it possible to share session state between asp.net aspx page making a call to an asp.net webservice

My Situation: I have 1 asp.net application with both aspx pages AND webservices I make calls (using ajax) to the webservice from an aspx page - all within the same asp.net application! Here is my problem/question Is there any way to share the session state? I.e. - the aspx page has a sessionID and the state is being maintained. Whe...

Session lost when opening IE window from application hosted in Outlook

An ASP.NET application (actually with Silverlight but it doesn't matter) is hosted in Outlook as folder home page. In this application there's a link to open popup window, which opens a separate IE window, not in Outlook. The problem is that in this case it seems that ASP.NET session is lost. A call to ASP.NET service has nothing in Ses...

Using ASP.NET session state with Silverlight (PRISM)

Hi, The scenario: I have a PRISM application developed in Silverlight (4), and I'm using a ASP.NET server side application to host several web-services (which, in turn, accesses WCF-services, but that's not really important here). The Silverlight application must be able to call the web services cross-domain (meaning that the web servic...

Reuse another ASP.NET session (set Session ID)

My problem is that when I open web application from Outlook in a separate IE window, the ASP.NET session is lost. This is (as described in several places) because in-memory cookie is lost. So it goes like this: User works with ASP.NET web application in Outlook, and this stores some info in ASP.NET session User clicks Print to open ne...

ASP.NET SQL Session db setup problem/confusion

I'm trying to set up an ASP.NET app to use SQL backed sessions. When I run the following code Session["test"] = 1; a row is inserted into the ASPStateTempSessions table in session database, which makes me thing that it is all set up fine. But when a user logs in, no entry is made in that table. It should be, right? If not, where i...