让Session对象在不同域名下实现共享

湮封

湮封

2016-01-29 18:03

让Session对象在不同域名下实现共享,让Session对象在不同域名下实现共享
  There is a general belief among developers that session state maintenance is always against one
domain / site. And therefore one can not maintain session state across different domains. Usually there is
no such requirement to maintain session state across different domains. But of late due to increase in the
scope of web based applications developers feel the need to share the session state with other domains.
The other domain may be a sister concern of the same company, or may be the B2B partner. So the question
arises how one can share the session variables across other domains easily and safely.

--------------------------------------------------------------------------------


  
How to share Session variables across Domains


Introduction  
      There is a general belief among developers that session state maintenance is always against one
domain / site. And therefore one can not maintain session state across different domains. Usually there is
no such requirement to maintain session state across different domains. But of late due to increase in the
scope of web based applications developers feel the need to share the session state with other domains.
The other domain may be a sister concern of the same company, or may be the B2B partner. So the question
arises how one can share the session variables across other domains easily and safely.

  

Sharing Session variables using aSMS  
     
      Configure aSMS


      Sharing Session variables across domains is very easy using aSMS. aSMS Standard and Advanced both
support sharing session variables. Lets assume two different domains mydomain1.com and mydomain2.com. And
the requirement is to share the session variables between mydomain1.com and mydomain2.com. For simplicity
sake lets assume one webserver each for mydomain1.com and mydomain2.com. (It’s also possible so share
session variables between different domains hosted on same webserver). So www.mydomain1.com points to
webserver of domain1 and www.mydomain2.com points webserver of mydomain2.com.

Install aSMS on both webservers. Both aSMS should share a common LDAP server to share session variables.
Lets assume that common LDAP server be ldap.mydomain.com. On the webserver of mydomain1.com, open the aSMS
Admin Console.

For the,

LDAP Path enterLDAP://ldap.mydomain.com:1002/o=mydomain/ou=Members
LDAPAdminentercn=Administrator,ou=Members,o=mydomain

Enter the Admin Password. Set your Session Time out duration. If you want to support cookies then set
Support Cookies to True.




Click ‘Test LDAP Source’ button. If it returns ‘Successful’ Then aSMS has been configured successfully
on the webserver of mydomain1.com.




Do the same on the webserver of mydomain2.com. Take care to enter the same LDAP path
(LDAP://ldap.mydomain.com:1002/o= mydomain/ou=Members)for the webserver of mydomain2.com. This way we
ensure that aSMS of both webservers point to the same LDAP Server. Test LDAP connection by clicking ‘test
LDAP source’ button. If it returns successful then aSMS has been configured properly on webserver of
mydomain2.com also and they both point to the same LDAP server.

  
     
Start Session on Webserver of mydomain1.com


  One can use the functions.asp (link to function.txt) given in the sample files and include this file in
all asp pages. If functions.asp has been used then Session can be started by just calling SessionStart
function on the default.asp of mydomain1.com webserver.

If function.asp is not used, then following code can be used to start the session in default.asp page

< %

Set objSession = Server.CreateObject("Session.Managem
展开更多 50%)
分享

猜你喜欢

让Session对象在不同域名下实现共享

ASP
让Session对象在不同域名下实现共享

查看一个顶级域名下所有的二级域名

电脑网络
查看一个顶级域名下所有的二级域名

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

在PowerPoint中实现对象翻转

办公软件
在PowerPoint中实现对象翻转

在PPT中实现对象翻转

电脑入门
在PPT中实现对象翻转

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

实现跨域名Cookie

PHP
实现跨域名Cookie

Session对象在各浏览器中的有效范围

ASP
Session对象在各浏览器中的有效范围

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

系统管理员手册:Unix系统安全必读

系统管理员手册:Unix系统安全必读

Web网站的错误控制

Web网站的错误控制
下拉加载更多内容 ↓