开发者

Creating a cookie using ASP.net

I have a sharepoint webpart where I have links to go to different web sites to which login is required. Therefore, I think i need to log the users on before redirect them into deep pages in that site, therefore I think i need to set up a cookie to that web site when the web part is loaded (by using the开发者_开发知识库 user credentials of the user's active directory information).

How can I achieve this requirement with out opening up a new browser window? (Though I have used a client side script, it pops up a new browser window)

Any help is highly appreciable...

Thanks


If you are referring to "different web sites" as sites having completely different URL's, then it's probably not possible without SSO system. The reason is that it's impossible to read/write cookies from other domain in web environment, i.e. pre-login the users like you are saying.

If all the sites are inside same domain, like mycompany.com for example, and different sites are in abc.mycompany.com or mycompany.com/subsite, then yes, you can set the cookie. See top section here http://www.15seconds.com/issue/971108.htm

A simple way to implement SSO is by implementing method described later on in same article. in the "Requesting Cookie from Another Domain". This is not a very secure method though, but can be done if you restrict it properly to specific slave domains. And obviously all the slave sites have to be modified, as with any SSO implementation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜