Sign in to follow this  
Followers 0
DjDeep00

Different IE windows but same login

25 posts in this topic

The following code opens up two ie windows. If you login to yahoo in one of the windows, the other window becomes same as the window u logged in as. Basically if you click "Login" in window 1 and successfully log in "Joe", then if you click "Login" on window 2, you will see Joe's email.

Not sure if I have to use _ieattach or its a cookie thing. Please advise.

Sample Code:

$Total=2

Dim $oIE[$Total]

For $x=0 to $Total-1

$oIE[$x] = _IECreate("www.yahoo.com")

Next

Share this post


Link to post
Share on other sites



It's a cookie thing.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

It's a cookie thing.

Dale

Damn cookies. You think, there is another way? I mean if I manually open two internet explorer windows then I have no problem. I just doesnt work with the script. :P

Share this post


Link to post
Share on other sites

I also ran into similar issue; a work around is to disable the cookies (If you can).

The webpage should be designed in a way that prevents this frorm happening.


"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

Share this post


Link to post
Share on other sites

I also ran into similar issue; a work around is to disable the cookies (If you can).

The webpage should be designed in a way that prevents this frorm happening.

Ok. So how come I dont run into the "cookie problem" by manually opening two internet explorer browser and do what I gotta do. How come the script is differnet? Sorry I am bit confused. :P

Share this post


Link to post
Share on other sites

Ok. So how come I dont run into the "cookie problem" by manually opening two internet explorer browser and do what I gotta do. How come the script is differnet? Sorry I am bit confused. :P

It depends on what actions you do while the two web windows are open.

Trust me, if you disable the cookies you will never see this issue again.

Do this test:

1- Open yahoo then login.

2- View your inbox then copy the link

3- from the start menu open RUN and paste the link then click OK

Now you have two windows open and they are both logged in to your inbox!

4- on one of the pages click logout then close the window.

Now you will see that the other page was logged out too.

If that happend this means that Yahoo is sharing the cookies :nuke: .

RK


"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

Share this post


Link to post
Share on other sites

It depends on what actions you do while the two web windows are open.

Trust me, if you disable the cookies you will never see this issue again.

Do this test:

1- Open yahoo then login.

2- View your inbox then copy the link

3- from the start menu open RUN and paste the link then click OK

Now you have two windows open and they are both logged in to your inbox!

4- on one of the pages click logout then close the window.

Now you will see that the other page was logged out too.

If that happend this means that Yahoo is sharing the cookies :P .

RK

How should I go bout disabling the cookies? I tried with IE settings but then Yahoo wont log me in. Is there a way delete a cookie after its created for one ie browser?

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

How should I go bout disabling the cookies? I tried with IE settings but then Yahoo wont log me in. Is there a way delete a cookie after its created for one ie browser?

I have no idea.

I was wondering if there is a COM method that forces the web cookies for a specific window to be stored in a specific path.

If I were you I would Google this up and see what other people did to prevent this "cookies sharing".

RK

Edited by rbhkamal

"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

do they got the same URL? :P

else you probably could use

_IEQuit($oIE, "URL TO THE COOKIE")
Edited by aceloc

[quote name='AceLoc']I gots new sunglasses there cool.[/quote]

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

[edit: ignore my post, I just noticed that I didn't read the post clearly. sorry]

I think this is what the OP was referring to. I'll try and outline the instructions on how to do this.

1) Close all your IE browser windows.

2) Open one IE window by double-clicking IE icon.

3) Goto your e-mail website and login. Now do not log out, but go to another website like google.com.

4) Press "Ctrl + n" to create a new window of IE [NOTE: this new window of IE is still the same session as the previous window].

5) Now go back to your e-mail website with the new window. Voila you are still logged in.

6) Now minimize all IE windows, start another session of IE by double-clicking the IE icon.

7) Goto the same e-mail website with the new session window, it will ask you to login again!

What I think AutoIt does with _IECreate is that it launches a new session of IE everytime so the cookie isn't carried over so your new IE window won't show you the e-mail address. This is my speculation because I cannot confirm this on a Windows 98 machine (no taskmanager).

I am also curious about the same question since I have a similar issue here. Is there a workaround?

Edited by liquidzyklon

Share this post


Link to post
Share on other sites

[edit: ignore my post, I just noticed that I didn't read the post clearly. sorry]

I think this is what the OP was referring to. I'll try and outline the instructions on how to do this.

1) Close all your IE browser windows.

2) Open one IE window by double-clicking IE icon.

3) Goto your e-mail website and login. Now do not log out, but go to another website like google.com.

4) Press "Ctrl + n" to create a new window of IE [NOTE: this new window of IE is still the same session as the previous window].

5) Now go back to your e-mail website with the new window. Voila you are still logged in.

6) Now minimize all IE windows, start another session of IE by double-clicking the IE icon.

7) Goto the same e-mail website with the new session window, it will ask you to login again!

What I think AutoIt does with _IECreate is that it launches a new session of IE everytime so the cookie isn't carried over so your new IE window won't show you the e-mail address. This is my speculation because I cannot confirm this on a Windows 98 machine (no taskmanager).

I am also curious about the same question since I have a similar issue here. Is there a workaround?

If the only problem is with _IECreate() then I dont mind running IExplore.exe (same thing as double-clicking IE icon) and then somehow use _IENavigate and other IE UDFs to control the IE windows. Not sure if this is possible. Did anyone try this?

Share this post


Link to post
Share on other sites

If the only problem is with _IECreate() then I dont mind running IExplore.exe (same thing as double-clicking IE icon) and then somehow use _IENavigate and other IE UDFs to control the IE windows. Not sure if this is possible. Did anyone try this?

Is it possible? Please help.

Share this post


Link to post
Share on other sites

You cant use deleting cookies, or blocking them, because the cookie is what tells the site that your logged in, if you delete it, it wont see you as logged in, so you wont be logged in.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

You cant use deleting cookies, or blocking them, because the cookie is what tells the site that your logged in, if you delete it, it wont see you as logged in, so you wont be logged in.

100% correct. I agree with you. So is there any other way? Maybe somehow replicate the way you would open multiple ie windows manualy and navigate those pages? Maybe using IE UDFs? Please advise.

Share this post


Link to post
Share on other sites

Can anyone help me with this?

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

I'm not sure I quite know what you mean, but it sounds like you want to create an IE session with yahoo, and then have a second window within the same IE session. Here's something that might work for you (this one deals with 2 Google windows, but the principles are the same):

#include <IE.au3>

$url = "www.google.com"
$oIE = _IECreate($url, 1)
$title = "Google - Microsoft Internet Explorer" 
ControlSend($title, "", "ToolbarWindow324", "{ALTDOWN}")
sleep(10)
ControlSend($title, "", "ToolbarWindow324", "f")
sleep(10)
ControlSend($title, "", "ToolbarWindow324", "{ALTUP}")
sleep(10)
ControlSend($title, "", "ToolbarWindow324", "{ENTER}")
sleep(10)
ControlSend($title, "", "ToolbarWindow324", "{ENTER}")
sleep(1000)
$newtitle = "Google2 - Microsoft Internet Explorer"
WinSetTitle($title, "", $newtitle)
sleep(1000)
$handle = WinGetHandle($newtitle)
$oIE2 = _IEAttach($handle, "HWND")

You can get the second window into an IE object variable by first changing the title to make it different from the first one, grabbing the handle, and then using IEAttach. Dunno if that's what you wanted or not.

Edit: By the way, what's the shorter key command for send Alt+F? ;)

Edited by mikehunt114

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

Can anyone help me with this?

There are two types of cookies: persistant and per-session. Persistant cookies are stored in files on disk and are shared by all browser instances. Per-session cookies are stored in memory but they end up being shared by all browsers running in the same IEXPLORE.EXE instance, but not accross them.

If your cookies are per-session cookies, getting unique IEPLORE.EXE processes should allow you to do what you want. You can change the options for Internet Explorer to start each browser in a seperate process.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Dale, how would you go about opening a hidden IE window whose unique ID is the same as the "logged in" window?

Share this post


Link to post
Share on other sites

Not sure what this means: "whose unique ID is the same as the "logged in" window?"

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

You guys were talking about cookies, IE Windows, and authentication ("logged in").

If one IE window session is authenticated with yahoo with a per-session cookie, how can _IECreate or _IEAttach attach to that specific session?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0