Session是不同的,如果闪存上传照片到aspx页面 [英] Session is different if flash uploads photo to the aspx page

查看:94
本文介绍了Session是不同的,如果闪存上传照片到aspx页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为用户照片upload.aspx ASPX和名为get-photo.aspx另一个ASPX。我在用户照片upload.aspx的Page_Load方法设置会话[PHOTOID。

I have a aspx called user-photo-upload.aspx and another aspx called get-photo.aspx. I set the Session["PhotoId"] in the page_load method of user-photo-upload.aspx.

如果我访问用户照片upload.aspx通过浏览器正常,会话可以在GET-photo.aspx检索。
但是,如果闪光灯上传照片用户照片upload.aspx页,我不能得到会话[PHOTOID]在GET-photo.aspx。

If I visit the user-photo-upload.aspx through the browser normally, the session can be retrieved in get-photo.aspx. But if the flash uploads photo to the user-photo-upload.aspx page, I can't get the Session["PhotoId"] in get-photo.aspx.

我发现,使用访问通常浏览器或闪存的页面时,会话ID是不同的。我不知道为什么Flash使用另一个会话。

I discover that the Session ID is different when visiting the page using browser normally or by flash. I don't know why flash uses another session.

我应该怎么办?

推荐答案

Flash插件作为单独的客户端,所以浏览器和插件接收个人会话ID两者是预期的行为。

The Flash plugin acts as a separate client, so both the browser and the plugin receiving individual session IDs is the expected behavior.

您必须通过设置原始会话ID作为Flash影片一个变量来解决这个问题,无论是作为一个Flash变量或通过JavaScript,然后发出的第一个请求一起发送它作为一个GET参数传递给服务器,替换为Flash客户端与被给服务器中创建的新的ID。

You will have to work around this by setting the original session ID as a variable in the Flash movie, either as a FlashVar or via JavaScript, then sending it as a GET parameter to the server along with the first request issued, and replacing the new ID created for the Flash client with the one that was given to the server.

<一个href=\"http://stackoverflow.com/questions/4697162/swf-flash-uploader-invalidates-jsessionid-any-idea-to-restore-session-from-serve\">This问题涉及Java的同样的问题,也许它可以帮助你解决你的问题。

This question relates to the same problem in Java, perhaps it can help you to solve your problem.

这篇关于Session是不同的,如果闪存上传照片到aspx页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆