English 中文(简体)
session transfer issue from Tomcat to ASP.Net
原标题:

I am using Tomcat to host JSP and using IIS 7.0 to host aspx (C# + .Net 3.5 + VSTS 2008), and I have some session transfer issue from JSP page to ASPX page. JSP page is in one domain and all other aspx pages are in another domain. The issue is, I can not transfer session from aspx web page A to aspx web page B. I want to know anything wrong.

Here are more details,

  1. I have a jsp page contains some frames (to mesh-up content), and one frame is using aspx web page A as source of the frame;
  2. In aspx web page A, in page_load, I will initialize session and save session variable "customerID" in current session;
  3. In aspx web page A, I have a link points to aspx web page B (A and B belong to the same IIS 7.0 web site on a web server);
  4. I find when the jsp page is loaded, the session of aspx web page A will be initialized correctly in asp.net page_load method, and content of page A could be displayed correctly as a frame in jsp page;
  5. the issue is, when user clicks web page B link (in aspx web page A) in the frame inside the jsp page, web page B can not get the session initialized in step 4.

Is it by design session can not be passed? My confusion is why session information can not be passed from aspx page A to aspx page B, since they are both belong to the same IIS 7.0 web site?

BTW: I have tested that if I access aspx web page A directly in IIS 7.0 and then clicks link to aspx page B to access page B, session could be passed to page B correctly.

问题回答

Session is persisted per AppDomain. In IIS you can have multiple application pools that host different ASP.NET applications in the same site. An ASP.NET application is hosted in a virtual directory that has an application pool associated to it. If page A and page B belong to different application pools in IIS you cannot share session between them.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签