Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8319755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:25:25+00:00 2026-06-08T22:25:25+00:00

So I have sent close to two hours searching for an answer but nothing

  • 0

So I have sent close to two hours searching for an answer but nothing is working. I need to to send a few cookies through my webbrowser object but for some reason the cookies aren’t being read by my PHP file:

<?php die('Your username is '.$_COOKIE['user']); ?>

And my VB code to send the cookies:

For i = 0 To 4
uploadBoxes(i).Navigate("about:blank")
uploadBoxes(i).Document.Cookie = "user=" & username.Text
uploadBoxes(i).Navigate("http://*****/uploader/app.php")
Next i

Again, any help would be appreciated and yes, I do need to send it over the webbrowser object. I also have browsed through MSDN database and even that has shed little light on this problem.

—————————————— THE ANSWER ————————————————-

So I took the InternetSetCookie method and came up with this code that worked on making the cookies:

Imports System.Runtime.InteropServices

   ' No more data is available.
    Const ERROR_NO_MORE_ITEMS = 259

    ' The data area passed to a system call is too small.
    Const ERROR_INSUFFICIENT_BUFFER = 122

    Private Declare Function InternetSetCookie Lib "wininet.dll" _
     Alias "InternetSetCookieA" _
     (ByVal lpszUrlName As String, _
     ByVal lpszCookieName As String, _
     ByVal lpszCookieData As String) As Boolean

Private sub something()
              Dim bRet As Boolean
                bRet = InternetSetCookie("http://*****/uploader/app.php", _
                 "user", "admin")
                If bRet = False Then
                    MsgBox("Failed")
                End If
                uploadBoxes(i).Navigate("http:/*****/uploader/app.php")
End sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T22:25:27+00:00Added an answer on June 8, 2026 at 10:25 pm

    http://pinvoke.net/default.aspx/wininet.InternetSetCookie

      <DllImport("wininet.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _
          Public Shared Function InternetSetCookie(lpszUrl As String, _
          lpszCookieName As String, lpszCookieData As String) As Boolean
         End Function
    
    Imports System.Runtime.InteropServices
    Sub InternetSetCookiePseudoCode()
    '`CookieCollection` was populated using HttpWebRequest/Response calls
    Dim i As Integer = 0
    InternetSetCookie("https://www.url.com/", Nothing, CookieCollection(i).ToString() & "; expires = Sun, 01-Jul-2014 00:00:00 GMT")
    'repeat for however many cookies you've got
    
    browser.Navigate("https://www.url.com/", True)
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm so close on this one, but I need a little help. I have
I have two Tomcat servers that need to maintain a persistent connection to cut
I have two simple programs set up that share data through a unix domain
I have a bunch of XSD's from https://github.com/XeroAPI/XeroAPI-Schemas/tree/master/v2.00 I need to do two things:
i have been sent a directory tree of source code that i want to
Is there any solution to detecting if a POST have been sent with jQuery?
I have a server-sent events handler in ASP.NET Response.ContentType = text/event-stream; while (true) {
I have a CSV file sent to me in CSV. The field of interest
I have a form that is capturing data sent from a google LocalSearch API.
I have a file that is sent over https and I am handling with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.