Jump to content
Sign in to follow this  

Direct Access Of Ie Cookie Files

Recommended Posts


I am trying to figure out a way to automate logging into to several external Internet web sites for my department. Single Sign On. We are currently using Novell NDS not Active Directory so the normal tools that Microsoft provides for remote authentication are not available.

My idea is the use the DOS environment variable USERNAME as the remote web UserIds. The passwords could be set to a constant for the department. My problem is how do I send the USERNAME variable from the users workstation environment settings, to the browser ,and then to the web site. The idea I have is to us an Autoit program, run from the users login script, which directly writes a cookie for Internet explorer for these web sites.

On inspection of the cookie files used by Internet Explorer, they seem to be pretty simple text files which I should be able to recreate fairly easily, however, there is also the index.dat file which I do not know how to deal with.

Does any one have any guidance for me on this endeavour?



Share this post

Link to post
Share on other sites

The Document object does have a cookie property that you can use to read and write cookies. Typically this would be done from the source document coming from the server, so I am uncertain about security restrictions that may get in your way since I haven't tested.

In any case, something like this:

#include <IE.au3>
$oIE = _IECreate("http://you.web.site")
$oDoc = _IEDocGetObj($oIE)
$oDoc.cookie = $sCookie

$sCookie would be a semi-colon separated string of name-value pairs. The names and values can be arbitrary, but there is one expected one - expires=timeInGMT. If you do not set an expiration, the cookie will not persist when the browser exits. So, for example:

$sCookie = "name=JohnSmith;password=OurDepartment;expires=Mon 05 Aug 2006 02:33:22 GMT"


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

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...