http cookies

Discussion in 'Questions (Windows Mobile)' started by jonjk2029, Aug 24, 2008.

  1. jonjk2029

    jonjk2029 New Member Licensed User

    Hi,

    I'm writing a program that needs to send a cookie to a website to get the right info back. I have tried to use AddHeader(), but this throws up a .NET error when you try to add multiline data like cookie data.

    fileopen(df1,"cookie.txt",cread)
    cookie=filereadtoend(df1)
    fileclose(df1)
    wrep.new1
    wreq.new1(link)
    wreq.AddHeader("Cookie",cookie)
    --Errors at this point


    Can anyone help please?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Try to encode special characters like crlf according to this table: HTML URL-encoding Reference

    You will need something like:
    Code:
    cookie = StrReplace(cookie,crlf,"%0d")
     
  3. jonjk2029

    jonjk2029 New Member Licensed User

    Thank you for the advice Erel, I'm now using StrReplace(cookie,crlf,"") and have edited my cookie.txt to correct a silly error that I missed earlier.

    Thank you
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice