Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, November 22, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Off Topic Forums - General & Off Topic
Forum for off topic and general discussion. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to General & Off Topic | New ThreadView:  Search:  
 Author  Thread: Cookies are twarting me!
Marc Johnson
Posts: 252
 
Cookies are twarting me!Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Dec 06 1:26 PM
fiogf49gjkf0d
Ok I have a pretty simple sub (that works):
--------------------------------------------------
Sub txtFDICDblClick(Sender)
DIM strFDIC
DIM strURL

strFDIC = CLng(txtFDIC.Text)
strURL = "http://www2.fdic.gov/idasp/confirmation.asp?inCert1=" & strFDIC & "&AsOf=MostCurrent&Refer=ID"
msgbox strURL
Application.BasicFunctions.WebOpen(strURL)
End Sub
-----------------------------------------

The trouble is that the FDIC website uses session cookies and doesn't like me trying to go directly to the URL specified.

Anyone know a trick around this?
[Reply][Quote]
Marc Johnson
Posts: 252
 
Re: Cookies are twarting me!Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Dec 06 2:33 PM
fiogf49gjkf0d
Something I tried but didn't work as hoped is:
----------------------------
Dim strLaunchURL
strLaunchURL = "http://www2.fdic.gov/idasp/index.asp"
Application.BasicFunctions.WebOpen(strLaunchURL)
---------------------------

I set that code before launching the specific page (above). It creates the session cookie but the sub routine runs the two WebOpen functions so quickly that Windows opens both URLs at the same time so the session cookie has not been assigned in time for the second window to use it.

If I run the script again, with the browser window open it works fine.

Basically the only way I see this working, at this point, is two separate actions. One to open the browser initially, to get the cookie and then another action to pass the URL with my FDIC variable.

I can do this a number of ways but none of them seem very user friendly/transparent to the user.

Thoughts?
[Reply][Quote]
Marc Johnson
Posts: 252
 
Closer but still not perfectYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Dec 06 3:35 PM
fiogf49gjkf0d
Here is what I eventually wrote and it kinda works (I'll explain at the bottom):
=================
Sub txtFDICDblClick(Sender)

FDICInitialize

dim i
i = 0
Do While i < 5000000
i = i + 1
Loop

FDICPassthru
End Sub

sub FDICInitialize
Dim strLaunchURL

strLaunchURL = "http://www2.fdic.gov/idasp/index.asp"
Application.BasicFunctions.WebOpen(strLaunchURL)
End Sub

Sub FDICPassthru
DIM strFDIC
DIM strURL

strFDIC = CLng(txtFDIC.Text)
strURL = "http://www2.fdic.gov/idasp/confirmation.asp?inCert1=" & strFDIC & "&AsOf=MostCurrent&Refer=ID"
Application.BasicFunctions.WebOpen(strURL)
End Sub
==============

The problem with this approach is two-fold. One, the loop delay is dependent on the speed of the processor so newer systems may move too fast. Two, only new tab-based browsers are able to use this. IE 6 will open up two separate windows. The second window will not have the session cookie that the first window opens. We could force all our users to upgrade their browsers but that's not realistic.

So I'm back to the drawing board.
[Reply][Quote]
Bob (RJ)Ledger
Posts: 1103
Top 10 forum poster: 1103 posts
 
Re: Closer but still not perfectYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Dec 06 8:35 AM
fiogf49gjkf0d
Got a nice thread running here to yourself from yourself.
Happens to all of us at one time or another....
--
rjl
[Reply][Quote]
Marc Johnson
Posts: 252
 
Re: Closer but still not perfectYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Dec 06 7:25 AM
fiogf49gjkf0d
LOL Yea well I thought orginally that the topic might be useful, then I didn't want to look like a dummy. Now I just look like I talk to myself.
[Reply][Quote]
Bob (RJ)Ledger
Posts: 1103
Top 10 forum poster: 1103 posts
 
Re: Closer but still not perfectYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Dec 06 6:40 AM
fiogf49gjkf0d
It's an interesting topic.. not just attracting much attention - except for hecklers
--
rjl
[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: Closer but still not perfectYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Dec 06 7:59 AM
fiogf49gjkf0d
So THATS how to become a top ten poster!
[Reply][Quote]
Marc Johnson
Posts: 252
 
Re: Closer but still not perfectYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Dec 06 8:02 AM
fiogf49gjkf0d
I had to figure out a way to hit 100 posts some how J/K

I still don't have a good solution either. Sucks, but there are bigger fish to fry right now. I was hoping it would have been a quick solution. If the FDIC site didn't use session cookies it would have only been like 6-7 lines of very simple code, including the SUB/END SUB and a couple DIMs.
[Reply][Quote]
Doug Miller
Posts: 20
 
Re: Closer but still not perfectYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Dec 06 7:46 AM
fiogf49gjkf0d
You could try automating IE through COM, but I don't have any examples to give you, nor have I tried automating IE with vbscript, only VB6.
[Reply][Quote]
Marc Johnson
Posts: 252
 
Re: Closer but still not perfectYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Dec 06 7:51 AM
fiogf49gjkf0d
Doug,

Later next year I'll be getting a copy of Visual Studio. At that time I'll look at more powerful ways to manipulate IE or another browser to get my desired results. I'm not going to try to get data to pass back into SalesLogix (if even possible) with it's native dev environment. I'm not that good of a coder. LOL
[Reply][Quote]
Doug Miller
Posts: 20
 
Re: Closer but still not perfectYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Dec 06 8:11 AM
fiogf49gjkf0d
The reason I bring up this suggestion is because it will allow you to open and control 1 instance of IE, so you could open the initial page so the cookie gets set and then have it navigate to the detail page you are interested in.

Something like this may work
the gEventCookie hooks IE's events and allows subs in slx to fire in response to said events.. so in the buttonclick event, navigate to your initial web page, and then in the NavigateComplete2 sub, if the URL matches your initial site, navigate to your detail page..
'''''''''code below
dim IE
dim gEventCookie

Sub Button1Click(Sender)
set IE = CreateObject("InternetExplorer.Application")
gEventCookie = HookEvents(IE, "IE_")

IE.Navigate "http://www.google.com"
IE.Visible = true
End Sub

sub IE_NavigateComplete2(pDisp, URL)

select case URL
case "http://www.google.com/"
IE.Navigate "http://www.yahoo.com/"
end select
end sub

Sub AXFormDestroy(Sender)
if gEventCookie <> "" then
UnhookEvents(gEventCookie)
end if
on error resume next
IE.Quit

set IE = nothing
End Sub
[Reply][Quote]
Doug Miller
Posts: 20
 
Re: Closer but still not perfectYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Dec 06 8:12 AM
fiogf49gjkf0d
I need to learn how to format in here
[Reply][Quote]
Marc Johnson
Posts: 252
 
Re: Closer but still not perfectYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Dec 06 10:35 AM
fiogf49gjkf0d
Dude! This is looking good. So far so good. I need to test it on a couple other systems to confirm, but you may have just made me look like a hero! Thanks!
[Reply][Quote]
Doug Miller
Posts: 20
 
Re: Closer but still not perfectYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Dec 06 11:47 AM
fiogf49gjkf0d
np, and good luck!
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/22/2024 9:06:27 PM