在经典 ASP 中设置 SessionId? [英] Set SessionId in Classic ASP?

查看:12
本文介绍了在经典 ASP 中设置 SessionId?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 PHP 中,我可以通过使用 Session_id() 作为设置器来选择使用特定的 Session.

In PHP I can choose to use a particular Session by using Session_id() as a setter.

Classic ASP/VBScript 中是否有类似的功能?我有一个 VBScript 站点,根据页面的不同,它要么直接从浏览器调用,要么通过 HTTP 在内部调用.不幸的是,ASP 将它们视为两个单独的会话,因为用户的计算机调用一个,而服务器本身调用另一个.我想告诉服务器调用,嘿,使用 Session 123456",这样它就可以直接与调用页面的用户共享信息.

Is there any similar functionality in Classic ASP/VBScript? I have an VBScript site that, depending on the page, is either called directly from the browser or internally via HTTP. Unfortunately ASP treats these as two separate sessions, because the User's computer calls one and the Server itself calls the other. I want to tell the Server calls, "Hey, use Session 123456" so it can share info with the user calling pages directly.

有什么建议吗?有什么方法可以更改或命名页面上使用的 Session?

Any advice? Any way to change or name the Session being used on a page?

推荐答案

在 ASP Classic 中没有像 PHP 的 Session_id() 这样的内置方法.

There's no built-in method like PHP's Session_id() in ASP Classic.

ASP 的 Session 对象有一个严格的锁定机制来保证状态的一致性,因此这可以防止您在同一个应用程序池中使用相同的会话标识符发出额外的请求.

ASP's Session object has a strict locking mechanism that guarantees consistency of the state, so this prevents you to make additional requests with the same session identifier within the same application pool.

另一方面,很容易实现一个桥来与同一域下的不同平台(如 PHP)共享会话状态.

On the other hand it's easy to implement a bridge to share the session state with a different platform like PHP under the same domain.

如何从 PHP 访问 ASP 经典会话变量?

这篇关于在经典 ASP 中设置 SessionId?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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