I'm designing a single page web application with all the action happening on default.aspx. I store the user's user id in Session after he logs on. I use SWFUpload in default.aspx to upload files to upload.aspx. When upload.aspx receives a file, it checks HttpContext.Current.Session for the user's id. This used to work, but since recently HttpContext.Current.Session doesn't have any values regarding my session. I must have changed something along the line but I have no idea what.
Stranger still, it still works with IE, but not with either Firefox or Chrome. I also read something about Flash in Firefox mistakenly uploading IE's session cookie (I'm paraphrasing).
How do I retrieve the Session data from the upload page (Firefox and Chrome)?
This is a known issue with Flash and cookies on non-IE browsers. Here's a post over at swfupload.org that discusses a workaround, and 'just the code' over at snipplr. Basically Flash does not send your cookies (or sends IE cookies) on Firefox and Chrome, etc., so your SessionID is not sent with your upload.aspx request in those browsers. In IE it will work, though.
The workaround above is to send the SessionID and Authentication ticket in the post or url, and then in the Global.asax intercept the request and recreate the correct cookies before ASP.NET looks for them in order to retrieve authentication or session information.
来源:https://stackoverflow.com/questions/8868280/asp-net-session-state-not-available-on-another-webpage