Solved

Persistence of cookies and authentication tickets when CHtmlView launches new IE browser windows

Posted on 2004-04-03
8
676 Views
Last Modified: 2013-11-20
My clients must be authenticated with a .NET authentication ticket or cookie that persists over all browser windows.  It works correctly if I start the web application in Internet Explorer.  The authentication ticket will persist over any new window that is launched by a script on the page.

But if the user logs on from a page running in a CHtmlView, and then when the page launches a new IE browser window, the user is not authenticated in the new window and must log on in that new window.

Why is this so?  What must i do?
0
Comment
Question by:Shake29
8 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 10750872
I think you have a best chance to get answer in WEB development area. My guess is that IE security level should be reduced. However, you can get a good advice about cookies and authentication from WEB developers.
0
 

Author Comment

by:Shake29
ID: 10751614
How do i change the subject area
I don't see the option anywhere
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10751653
Post a request to move the question in the support area (link at the top of the page).
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 48

Expert Comment

by:AlexFM
ID: 10751703
You may open 20-poins question in WEB area with link to this question.
0
 

Author Comment

by:Shake29
ID: 10753508
CHtmlView is hosting the Internet Explorer ActiveX control.

The only difference I see so far between the ActiveX control and Internet Explorer is that authentication cookies don't persist between the Internet Exporer ActiveX control and a new Internet Explorer browser window.

And i believe it is a matter of having to override some implementation so that the ActiveX control shares the authentication cookie with the new Internet Explorer browser window.  But i don't know, hence why i'm here and in the MFC subject area.
0
 

Author Comment

by:Shake29
ID: 10754751
I will be closing this question, for I have solved the problem.

I have overrided the OnNewWindow2 event of CHtmlView.
In the event, i create a new document window, and the authentication ticket persists.
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 10754965
User resolved; points (250) refunded and question closed.

Solution posted in http://www.experts-exchange.com/Q_20943403.html is below.

Netminder
Site Admin

========

Solution:
I overrided the OnNewWindow2 event and created a new document frame having the same parent application....

void CBrowserView::OnNewWindow2(LPDISPATCH* ppDisp, BOOL* Cancel)
{
    // Get a pointer to the application object
    CWinApp* pApp = AfxGetApp();    // Get the correct document template
   
     CDocTemplate* pDocTemplate;
    POSITION pos = pApp->GetFirstDocTemplatePosition();
    pDocTemplate = pApp->GetNextDocTemplate(pos);
    ASSERT(pDocTemplate);    // Create the new frame

    CFrameWnd* pNewFrame = pDocTemplate->CreateNewFrame(GetDocument(),
                                   (CFrameWnd*)AfxGetMainWnd());
    ASSERT(pNewFrame);    // Activate the frame and set its active view
     pDocTemplate->InitialUpdateFrame(pNewFrame, NULL);

    CBrowserView* pWBVw = (CBrowserView*)pNewFrame->GetActiveView();
    ASSERT(pWBVw);
    pWBVw->SetRegisterAsBrowser(TRUE);
     *ppDisp = pWBVw->GetApplication();
}
0
 

Expert Comment

by:ChidigamBhanu
ID: 23836679
I need use in a seperate Dialog, i cannot use same browser as a  new window. Can any one kindly suggest me how can i fix this problem.
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
not able to insert into temp table 68 162
Separate into files by filename 12 83
Hibernate methods 2 71
sum28 challenge 31 112
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question