Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2004-04-03
8
681 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Process filename extension 3 194
wait notify demo infinite loop 3 122
Sed question 2 101
moto 4g phone enable finger print 4 26
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

856 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