Viewing Cookies Sent With Either Winsock Or INet Request?
Hello,
Is there a way that I can send a request via INET (Most Likely), and read the cookies which were sent with that request?
Thanks
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Viewing Request Header Using Internet Transfer Control
Hi Everyone,
I am sending data using the Internet Transfer Control 6.0 (SP4) in my project. Basically, I am writing a program to send information to WebMD to check for eligibility of a doctor's patient for medical coverage. They require certain pieces of information such as userid, password, message type, message, file, etc...
The data needs to be formatted using boundaries and the header gets formatted with the Multipart Form tag. I format the info being sent using the boundaries and inserting proper vbCrLf's as well as the right number of dashes.
However, my response back from WebMD is that there was an error. According to one of their programmers, none of the variables with their data is coming over.
I know how to get the Response Header from the Internet Transfer Control. I need to know how to view the Request Header to see if it is formatted properly.
Any help would be greatly appreciated.
Thanks.
Inet And Cookies
Someone suggested that I use a WinInet API to achieve what I want, but I would like to know if it is possible to manipulate cookies using the basic Inet control.
Currently I use inet.openurl to open a URL which stores cookie data, and then use inet.getheader to retrieve the header information (what cookie data is being stored, among other things)...I now want to be able to use this data to access the site using that cookie. I am aware that the inet control *stores* the cookie data (well, windows does, it's part of the IE cookie data) but I want to be able to switch cookies quickly...maybe there's a way to clear IE cookies or set them or something?
Anyone got suggestions?
Inet And Cookies
Hi,
I've having a big problem with my Inets. I'm working with a site that requires login (php), and the login is stored in the site's cookie.
The program works great for most people. However, there's an ever-growing handful of people who are simply not recognized by the site as being logged in.
Is there any reason why this problem would occur (maybe a setting in Internet Options)? Or, how can I make sure my Inets use Internet Explorer cookies?
Thanks.
INET: Send 3 Cookies
Ello, I was wondering how would I be able to send 3 different cookie name/values to a page, using the INET control?
Using Inet And Sending Cookies
Greetings...
When I use Webrowser cookies are sent nicely. What I want to do is use Inet which normally doesn't send the cookie so I end up getting the sign on page. How do I send cookies with Inet?
TIA,
Newbie Tony
Can Inet Store Cookies
I'm am trying to log into a website using Inet.Execute to Post information to a form. I can log in no problem and it returns the html from the page the form redirects to. However I need to be able after calling my login function to get the data from other pages behind the login. I need to be able to store the cookie.
I had been logging in using the webbrowser control then using Inet to grab the HTML. This worked fine expect that this program is designed to run in the background and must log in every five minutes. This caused a problem as the web browser control makes noises as it changes pages.
If anyone can help me either storing the cookie when i post the data or by removing the sound from the web browser control, I would be most grateful.
Grabbing The Cookies With INET?
is it possible to grab cookies that INET Sets? I'm trying to get the sessionid that it sets, but it's not working. I tried Inet1.GetHeaders, but it only gets the returning data. Would would i actually get the cookie Inet sets? is this possible?
MS Inet Control And Cookies
I was developing a small app in vb6 using the ms inet control to post data to webpages and receive the response. i knew i would need to be sending cookies back that they sent me so i wrote some functions to grab those, but it seems that this control reads the cookies that internet explorer gets, and also, automatically saves the cookies that get send to it.
for example, in a routine that logs into a website, if i wasnt logged in thru internet explorer before running the program, after i go thru the program and open IE i am already logged in.
I cant find any decent docs on msinet and it doesnt appear i can turn that feature off thru properties, is winsock better for this? ive always stayed away from that cause its a little more low level but it seems i may have to go that route?
anyone know about this already?
Cookies And Inet Control.
Im writing a software that parses html and gets information from a website. The problem is that the user can change what screen looks like. This is all controled via a cookie in IE. My problem is the Inet control uses the cookies in IE. Is there any way for me to disable/ignore the cookie when i request the page? Or am I screwed and need to rewrite in sockets.
Thanks,
Erik
Edited by - ebenson on 4/26/2005 7:39:36 AM
How To Use Cookies With Inet.execute [msinet.ocx]
I'm having trouble setting cookies while using the execute subroutine in the msinet control.
msinet.execute "http://www.mywebsite.com/", "POST", "variable=value", "Badname: blarrr!" & vbNewLine & "Cookie: name=value"
I've tried all different ways but can not figure out how to make msinet use the cookies I put into InputHdrs. All of the headers I put are used except cookies.
I've been trying to find a solution for hours.. Any help would be greatly appreciated!
Help Request For Inet (uploadstatus)
I am stuck with the inet control. I realy need an progresindicator for uploading a big file,
Does anybody know how to get the "percent uploaded" value?
I know how to work with the inet control so i prefer using that. I am sure some of you say: Use Winsock!
I know nothing about winsock so thats to hard for me i think
Hope somebody can help me out.
Inet - Request Timeout
My code is as follows
'***************************************
startdate = "5/1/2005"
enddate = "5/8/2005"
While nextdate <= enddate
newsletterExists = True
sDate = Day(nextdate)
sMonth = LCase(MonthName(Month(nextdate), True))
sYear = Year(nextdate)
url = "http://www.abc.com/" & sYear & "/" & sMonth & "/" & sDate & "/"
Set objinet = CreateObject("InetCtls.Inet.1")
objinet.RequestTimeout = 1000
objinet.url = url
sHTML = objinet.OpenURL()
Set objinet = Nothing
wend
'***************************************
If I debug the code (with F8) then the whole while loop goes through well. i.e. 8 times. But if I just run the code then after opening the url for about 2 times (i.e. 2 dates) an error message is prompted saying "Request times out"
Can someone tell me what is happening and what is the solution? I do'nt understand how it goes through when I debug the code and fails when I just run the code.
Also I have got this code from the net and used it:
Set objinet = CreateObject("InetCtls.Inet.1")
Please can you explain it. What is "InetCtls.Inet.1"? In some places it is given as "InetCtls.Inet".
Solution for the request timeout problem is kind of urgent.
Thanks
Akshay
Inet Control - Still Executing Last Request!!!
I have this problem with the inet control. Error code 35764
I initially started out with this app using the inet control to download and interpret a webpage at regular intervals and extract weather information from the page.
I then gave up using teh Inet control for most of the work but now I am just using the control to authenticate in a loop. The problem is that the Inet control does not seem to automatically clear its last request. I have tried the following to no avail:
VB Code:
'disable the program if the demo has sent more than 20 entries. If IsDemo Then If cn.Execute("select iif(sum(mailcount)+sum(netreach) > 20,-1,0) from mail").Fields(0) Then s1 = InetCtl.OpenURL(SomeUrl) Else 'authenticate as normal as would be the case for the actual program s1 = InetCtl.OpenURL(WEB_ADMIN_URL & WEB_ACTION_AUTH & "ps=" & s & "&ds=" & ds & "&bname=" & BName & "&em=" & GetOption(Common.OP_EMAIL_ADDRESS)) End If End If InetCtl.Cancel Do While InetCtl.StillExecuting DoEvents Loop
Can anyone help please???
Winsock Syntax? (To Request A Website With The Winsock Control)
Ok, I don't know very much about Winsock and am just now starting to use it. I'm making an anonymity program that modifies referer and user agent data. I managed to find an example of how its done on planetsourcecode.com but there's a few things that aren't working.
Anyway, when this string is sent, it sends the headers and a request for index.html from the connected host (winsock1.connect domain.com 80).
GET index.html HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-comet, */*
Accept-Language: en
Accept-Encoding: gzip , deflate
Cache-Control: no-cache
Proxy-Connection: Keep-Alive
User-Agent: Whatever
Referer: www.whatever.com
But when I used the website http://ipid.shat.net/ as the domain to see if code mdified the headers or not, it directed me instead to just www.shat.net. How would a browser request information to ipid.shat.net?
Also, I noticed that by sending just that information, cookies don't work properly. What other tags do I have to add onto that for it to recieve my session information? Thanks a lot.
Request Timed Out Using Multiple Inet Controls To OpenURL
Guys I have a problem that I'm not sure what is wrong.
I put an Inet control as a control array, and i have 10 indexes (Inet1(0) to Inet1(9)).
I have 10 Timers that call each of these Inet every 1 second with OpenURL method to get a page from a website.
Problem is It will hit a Request Timed Out error when i have all of them running. But when i run say 1 or 2 of them, they're good to go. The web server which i'm going to pull the page form is OK, the Network is OK too.
Has anyone experienced the samething before ?
Winsock / Cookies..
How do I set my cookies? I've done InstrRev to get all the data I need I just don't know how to make winsock use them. The application is a program for a RPG website which needs me to stay logged in so after I login I set my cookies (some how) then do I need to add my Cookies with each page I visit or does winsock just continue to carry the cookies with it?
Winsock And Cookies
Hello,
I working on a winsock control that interact with websites who contain a loginsystem.
Ive managed to create a winsock who is capable to post variable on the server, but i always return to the loginform. So I concluded even if the cookie is registerd on my pc, im not logged in via my winsock handler...
How can i send the cookie to the server so im logged in via my winsock control?
Thx for your time...
Cookies And Winsock
lets say I have:
VB Code:
Cookie name: samplerValue: 1105058236Server: netscape.comExpire: 2005-12-28 Cookie name: CoBrandedForValue: AIMServer: netscape.comExpire: 2005-12-28
How would i send that in winsock?
Winsock And Cookies
Hi,
My Winsock application is working great, with one exception.
I'm using the POST method to send data to a site. My problem: this site identifies users by their cookies. The cookies contain information that is critical for the site to interpret. If I don't have the cookie, the POST won't work.
Is there any way I can get Winsock to accept cookies, or read cookies?
Thanks!
Accepting Cookies With WinSock?
I'm working on a program which will log me into eBay at the time I tell it and bid on an item for me when I'm not around to do it. The problem is that I'm using WinSock to login to eBay, acting as a web browser, but eBay won't let me because "your browser does not support cookies." Is there a simple way I can allow WinSock to accept cookies? Or is there another method I should be using to sign in which would work better than WinSock? I would simply use the WebBrowser control but in the event that I give this program out to any friends, I'd rather they be able to use it without needing the IE control. Any suggestions are appreciated
SSL And Cookies Via Winsock Control?
Hi,
Is it possible to connect to https via Winsock control? Would it just be a matter of specifying the SSL port on the remote server or is there more too it than that?
Also, what about cookies? Some pages require you to first download a cookie by logging in. My idea would be to connect to the login page first, have the cookie downloaded and then access the content. But, because I logged in via Winsock, did the cookie ever download? If so, can the Winsock control actually use the cookie?
Any and all help, guidance or resources on the above 2 subjects would be greatly appreciated..
Dan
Setting Cookies With Winsock
How do I set my cookies? I've done InstrRev to get all the data I need I just don't know how to make winsock use them. The application is a program for a RPG website which needs me to stay logged in so after I login I set my cookies (some how) then do I need to add my Cookies with each page I visit or does winsock just continue to carry the cookies with it?
Internet Cookies And Winsock Control
Hello Everybody,
I am trying to create an internet cookie using "wininet.dll" and trying to connect to the Server using Winsock Control in the Form Load Event. However I am having problems creating an Internet Cookie and connecting to the Server in the form load event.
Can anyone tell me what could be the problem be..
Pls guide...
Label2.Caption = "Connecting to Remote Server at:" & tcpClient.RemoteHost
tcpClient.RemoteHost = "10.0.6.39"
tcpClient.RemotePort = 8000
tcpClient.connect
connect = True
InternetCookieCreate "http://www.vbusers.com", "SetPhoneStatusChange", "DataSetPhoneStatusChange"
MsgBox "SetPhoneStatusChange Successfully Created"
'GetPhoneStatusChange
Debug.Print InternetCookieGet("http://www.vbusers.com", "", "DataGetPhoneStatusChange")
MsgBox " GetPhoneStatusChange Successfully Created"
Rahil
Setting/Sending Cookies With Winsock...
K, i've been working on building a http wrapper and recieved some help some friends with getting the cookies, I would ask them how to set the cookies but we only talk threw e-mail so their responses take a few days sometimes.. If I gave you my project or the user control and an example of what I am trying would you see if you could help me out?
the basic wrapper syntax looks like this..
Code:
'Web is the name of my user control.
Public Function GETPage(gURL As String, Optional gReferer As String, Optional gCookies As String)
Public Function POSTPage(pURL As String, Optional pReferer As String, Optional pData As String, Optional pCookies As String)
Public Function MakeCookies(mText As String)
CookiesTemporary = mText
While InStrRev(CookiesTemporary, "Set-Cookie:")
CookieTemporary1 = InStr(1, CookiesTemporary, "Set-Cookie:") + 12
CookieTemporary2 = InStr(CookieTemporary1, CookiesTemporary, ";")
CookieTemporary3 = Mid(CookiesTemporary, CookieTemporary1, CookieTemporary2 - CookieTemporary1)
If BuildingCookies <> "" Then BuildingCookies = BuildingCookies & "; " & CookieTemporary3
If BuildingCookies = "" Then BuildingCookies = CookieTemporary3
CookiesTemporary = Right(CookiesTemporary, Len(CookiesTemporary) - CookieTemporary2)
Wend
MakeCookies = BuildingCookies
End Function
I didn't code the part to get the cookies because I have never used them before.
so I really don't know how to set and send the cookies with winsock.
Code:
Web1.GETPage ("http://www.website.com")
sNeoHtml = Web1.GETPage("http://www.website.com/loginpage.phtml")
If InStr(sNeoHtml, "<b>Log In to website</b>") + 23 Then
StatusBar.SimpleText = "Status: Posting Username " & txtUsername.Text
sNeoHtml = Web1.POSTPage("www.website.com/loginpage.phtml?", , "destination=/petcenteral.phtml&username=" & sUsername)
If InStr(sNeoHtml, "Remember, never") + 14 Then
StatusBar.SimpleText = "Status: Posting Password.."
sNeoHtml = Web1.POSTPage("www.website.com/hi.phtml", , "?username=" & sUsername & "&password=" & sPassword, sCookies)
How Do I Use the cookies?
If anyone willing to help would like the whole project I could sent it to them.
Winsock/cookies + Multiple Connections
Hello, I am wondering if this will work.
I want to connect to a website throught multiple accounts. The website uses cookies. Reading the cookies and sending them to winsock is no problem for one account. What I want to do is let the user connect multiple accounts at the same time to the website.
So would storing the cookies in an array and sending them to winsock do the trick?
If so I know how I would do everything, I think, except would I have to continuely send winsock the cookies with each page it goes to on each individual accounts?
*Ps. I'm using the WinSock Control right now but I might if I have to switch over to the WinSock API
Thanks for your insight,
The president
Code:' Vote For me!
Edited by - President on 5/28/2004 12:06:36 AM
Winsock Request
I have a Winsock component setup right now on my network, exact same as whats in this thread
I would like to know if a similar control can be built using Winsock to do this:
1) Connect to a remote computer, by IP address. (I have a code that determines the IP address of the remote machine already..)
2) Open a .txt file, send it back to (my) the users computer and displays it in a text box on screen.
3) On command button press, take what ever is in my text box, and send the file back to the remote computer and save it.
Kind of like editing a configuration file, remotly.
I know the application would have to be running on the remote end as well as my end for this to work, if its at all possible.
I would really like to do this, I appeciate everyones help in advance!
Winsock Example Request
I'm at work where I can't get to any help files for winsock. Can somebody give me a quick example of the code required to create a winsock instance, including telling it to listen and respont to internet requests? I'm going to attempt to make MS Access act like a simple server, and I just don't have the resources here to get it running. Thanks!
Winsock HTTP Request Help
I need help with this, my wrapper uses winsock to send requests and the close event does not fire which makes the connection stay open forever, my wrapper is at the bottom it is a attachment
WinSock Request Accept
Hey,
I have been trying to get this code to work, It's most likely something stupid am doing, but i cant get my server program type thingie to accept the Request ID from the client program thingie... Here is the code to the part that it says is wrong (If you need anyother parts tell me an i'll post it)
Code:
Private Sub HostSocket_ConnectionRequest(ByVal requestID As Long)
'Show Request In Host Log
HMsg = "Connection request id " & requestID & " from " & HostSocket.RemoteHostIP
HostLog.AddItem (HMsg)
sRequestID = requestID
iSockets = iSockets + 1
ConNumber.Caption = iSockets
Load HostSocket(iSockets)
HostSocket.LocalPort = 1007
HostSocket.Accept requestID
End Sub
PS. I looked at an example to help me with this, so am not sure whats wrong.
Thx in advance.
Ali.
Can Winsock DLL Do Other Protocol Request ...
guys,
i find that the winsock OCX really is limited in its capability...
can anyone suggest me a better one for network programming? because the protocol type is limited to a few only....
I hope to do RTSP / RTP request ... is there any thing that i can used to do that ???
can Winsock Dll do other protocol request or its the total same with the winsock OCX?
Does anyone has a sample using winsock DLL (as client)...??
Multiple Request With Winsock
Greeting,
I have a little problem with winsock. I have a server and several
client. I want to transfer text from server to client trough the network
In this case, I using winsock to transfer the text. It is ok when only 2
computer connected (1 server and 1 client). But, when 3 computer
Connected (1 server and 2 client) I cant broadcast text to all client.
Does any body know how to broadcast text fom server to client trough the
network and winsock?
thanks
Rgds,
Rano Nugrah Agung Homan
Winsock Sample Request
Hi all,
I need to make a server app for my project. I have concluded that I will need to implement Winsock to do so. I have read up on all Winsock articles here (and many others elsewhere) and have downloaded and studied all the samples I could find.
However, I am unable to do what I want because:
- The tutorials say that the IP address or friendly name of the target computer MUST be specified for the Winsock control to connect on the other side. This strikes me as very backward, as I can not always know what IP addresses my customers' network stations will be running on and cannot also predict their friendly names. Does this have to be hard-coded?
- Try as I may, I cannot create a working sample of Server.Exe and Client.Exe to run on the same machine as I cannot afford the luxury of testing my code over two machines. Is there any way I can debug / test on one machine?
If any member proficient with Winsock (Laura Stephens and Jason Rogers come to mind) would like to help, I shall appreciate a small sample to get me started by solving the above two problems.
GoodGuy
Experience is a bad teacher for its exams precede its lessons.
Edited by - GoodGuy on 12/10/2007 10:23:30 PM
Using Winsock To Retrieve Html File Doesn't Send Cookies
The html file I would like to download is from a forum page and it requires the user to be logged in with cookies enabled. I found some code which would let me use winsock to send an HTTP request to the server but it doesn't send any cookie information so the html file returned is one saying that the user is not logged in. How to I send this cookie information using winsock?
I found that I could use the Inet API and this information would be sent automatically but the API made the program very unresponsive because it does everything syncronously.
Viewing Other's Desktop Using WinSock And Win API In VB
Hi Friends,
Can anyone give me the code which uses winsock control and windows API in VB to view selected machine's
DeskTop using win API..I need this Code urgenly for my Project.
Thanks and Regards
prasanna venkatesh S.
Winsock Array Connection Request
i made a post a couple days back gavino answered
im trying to make my multi chat program and well, it isnt goin by too well. for starters the client cant connect
Code:
Private Sub sckSocket_ConnectionRequest(Index As Integer, ByVal requestID As Long)
SockNum = SockNum + 1
Load sckSocket(SockNum)
sckSocket(SockNum).Listen
sckSocket(SockNum).Accept requestID
End Sub
is there sumthing wrong with that?
[VB6] Winsock POST Request Problem
I'm trying to connecto to google.com and translate a simple word (just to test if works).
And I have a problem when I'm sending POST request data, here is my code:
Code:
Private Sub Command1_Click()
Winsock1.Close
Winsock1.Connect "www.google.com", "80"
End Sub
Private Sub Winsock1_Connect()
Dim packet As String
Dim strpost As String
strpost = "hl=it&ie=UTF8&text=hello&sl=en&sl=en&tl=it&tl=it"
packet = "POST /translate_t HTTP/1.1" & vbCrLf
packet = packet & "Host: www.google.com" & vbCrLf
packet = packet & "Accept: */*" & vbCrLf
packet = packet & "Accept-Language: it,it-it;q=0.8,en;q=0.5,en-us;q=0.3" & vbCrLf & vbCrLf
packet = packet & "Content-Type: " & "application/x-www-form-urlencoded" & vbCrLf
packet = packet & "Content-Length: " & Len(strpost) & vbCrLf
packet = packet & strpost
Winsock1.SendData packet
Text1.Text = Text1.Text & packet
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim data As String
Winsock1.GetData data
Text2.Text = Text2.Text & data & vbCrLf
End Sub
As you can see I want the GETDATA in Text2.Text but I recieve this error:
Code:
HTTP/1.1 411 Length Required
Date: Fri, 01 Aug 2008 13:57:24 GMT
Content-Type: text/html; charset=UTF-8
Server: GFE/1.3
Content-Length: 1357
{html code}
What's the problem?!
Thanks in advance.
WinSock Connection Request Error!
When I use this code for a winsock connection request:
Code:
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Winsock1.Accept requestID
txtRecive.Text = txtRecive.Text & vbCrLf & "ChatX: Connection Request Detected."
End Sub
I get runtime error 40020:
Invalid operation at current state
when I hit debug it highlights that code snippet up there! HELP
Winsock Server Connection Request Problem
hey, this is my code
Code:
Private Sub wskServer_ConnectionRequest(ByVal requestID As Long)
Dim msgboxResult
msgboxResult = MsgBox("A connect request has been initiated by: " & wskServer.RemoteHostIP & vbNewLine & "Would you like to accept it?", vbYesNo, "Connection Request")
If msgboxResult = vbYes Then
wskServer.Accept requestID
isServer = True
End If
End Sub
now the problem is, whenever i run it, and have a client try to connect to it, this is the error the server gives me on this line "wskServer.Accept requestID"
---------------------------
Project1
---------------------------
Run-time error '40020':
Invalid operation at current state
---------------------------
OK
---------------------------
can someone help?
EDIT: and yes, i did try:
wskServer.Close
wskServer.Accept requestID
but it doesn't work. if u need 2 see my whole code to know whats going on, just let me know
Winsock/cookie Request Entity Too Large...
hi i'm sending a cookie header via winsock but i think it's to large cause I'm receiving a "Request Entity Too Large" in the HTTP Response. is there a way around this?
Winsock - Notification When User Accepts Request
Does anyone know of a way that an initiator of a Winsock connection can be notified when a user on the other end accepts the connection ? I'm new to Winsock, so my terminology might not be the best, but I'm trying to find out if the inititator has any way of knowing that a connection was made before any messages are exchanged?
Thanks for any help....
|