是否在iframe之间共享ASP.Net会话?

时间:2020-12-19 16:49:20

Can two or more iframes share the same session data?

两个或更多iframe可以共享相同的会话数据吗?

2 个解决方案

#1


3  

Session data is stored by your server. Iframes are just "pages".

会话数据由您的服务器存储。 iframe只是“页面”。

If the requests for both pages are served by the same server (or farm in the event of a suitably configured load-balanced environment), the requests have access to the same session data.

如果两个页面的请求都由同一服务器(或在适当配置的负载平衡环境中的服务器场)提供服务,则请求可以访问相同的会话数据。

You can run into temporal issues in some circumstances; namely, if you set some session variable during the request for one page, but the other iframe expects that value to be set already, you won't have what you want.

在某些情况下,你可能会遇到时间问题;也就是说,如果您在一个页面的请求期间设置了一些会话变量,但另一个iframe期望已经设置了该值,那么您将无法获得所需的值。

#2


3  

Yes. If they are in the same web application they will share the same session

是。如果它们位于同一Web应用程序中,则它们将共享同一会话

#1


3  

Session data is stored by your server. Iframes are just "pages".

会话数据由您的服务器存储。 iframe只是“页面”。

If the requests for both pages are served by the same server (or farm in the event of a suitably configured load-balanced environment), the requests have access to the same session data.

如果两个页面的请求都由同一服务器(或在适当配置的负载平衡环境中的服务器场)提供服务,则请求可以访问相同的会话数据。

You can run into temporal issues in some circumstances; namely, if you set some session variable during the request for one page, but the other iframe expects that value to be set already, you won't have what you want.

在某些情况下,你可能会遇到时间问题;也就是说,如果您在一个页面的请求期间设置了一些会话变量,但另一个iframe期望已经设置了该值,那么您将无法获得所需的值。

#2


3  

Yes. If they are in the same web application they will share the same session

是。如果它们位于同一Web应用程序中,则它们将共享同一会话