Sending multiple HTTP cookies under JDK1.3

Can anyone tell mw how to send at HTTP request (java.net.HttpURLConnection) with 2 cookies for (!!!) JDK1.3.1
Here, for 1.4.x you can do
URL conn = new URL("http://localhost/test.php");
URLConnection uconn = conn.openConnection();
uconn.addRequestProperty("Cookie", "ima=cookie");
uconn.addRequestProperty("Cookie", "its=cookietoo");
but in 1.3 you've no addRequestProperty(), just setRequestProperty() that overwrites old headers. There's an explanation in APIdoc, but I can nor understand it, neither make it work. As they write, I should do
URL conn = new URL("http://localhost/test.php");
URLConnection uconn = conn.openConnection();
uconn.setRequestProperty("Cookie", "ima=cookie,its=cookietoo");
but that gives a cookie with data "ima=cookie,its=cookietoo", not the one I want.

Former PERL programmer? That's not.
Looking at jcookie.sourceforge.net I decided that was really Sun's bug, I found some HttpURLConnection methods don't work as they should. For ex.,
HttpURLConnection.set[Instance]FollowRedirects(boolean)
makes it use "Location:" headers, but not collect "Set-Cookie:" ones, what's often implemented in login systems (e.g. login CGI script sets login cookie & redirects to another page, while this class loses that cookie).

Similar Messages

  • Multiple set-cookies directives

    Hi All- I'm testing against an http server that sends multiple set-cookies directives (there are 4 cookies total). As far as I can tell, it is legit HTTP to either send a single set-cookie directive with multiple cookies in it, or multiple set-cookies directives. I am getting erratic behavior. Using the wtk emulator, i am able to receive and process multiple set-cookies directives. Using some phones it works, on others it doesn't. I am trying to create a unit test for my code, and I am unable to figure out how to set up the classpath the same way the emulator does to work with multiple set-cookies directives.
    I searched the jars in the wtk22 directory, and it appears that wtklib/emptyapi.zip, wtklib/gcf-op.jar, lib/midpapi10.jar and lib/midpapi20.jar all contain the HttpConnection class. I am guessing that the emulator is picking up a different implementation than my unit test or the phones that don't work? Has anyone encountered and solved this problem before? Is there a way at runtime to determine from which jar a class was loaded?
    thanks,
    Bleu

    I have a very similar authentication flow in my app.  Using native calls (HttpClient) I am able to retrieve the authentication token, and can easily set a cookie with that token, and use the cookie with subsequent
    native calls via HttpClient.
    I believe that what you are asking for is the ability to add that cookie (with the token you got natively) into the webbrowser control's cookie store
    BEFORE trying to load your dashboard page.  You want your webbrowser control's request for the dashboard page to provide the cookie so that the user doesn't have to log
    in again, and only one webbrowser request is made.  Is this correct? 
    Sadly, I do not think this is possible.  The other answers describe how to add a cookie to a webbrowser control's page after that page has been loaded.  This is adding the cookie to the "document" within the browser control, not
    into the webbrowser control's store.  These approaches will not allow you to add the cookie into the webbrowser control's store, ahead of time, so that it will be sent when you first request the page. 
    If I am correct about what you are asking for (I want this too!) it is not supported on Windows Phone as you cannot write directly to the webbrowser control's cookie store.  You can read it, but not write to it.  It's sad as this particular
    authentication flow is very common, and easy to achieve on both iOS and Android... just not on Windows Phone.
    To get around this in my app, I perform my native authentication (HttpClient) and then authenticate
    again within the webbrowser control itself.  Basically, load the login page into the browser, then submit the login form via eval of JavaScript, and when that finishes loading (valid
    response), load the actual target page.  This is a fragile and inefficient hack, but it seems to work. 
    Hope this helps...

  • How can I send multiple pictures to the Kodak link (under file & then order prints)? if the photos are not sequential can it be done?

    how can I send multiple pictures to the Kodak link (under file & then order prints)?  if the photos are not sequential can it be done?

    Does the order matter here?Because the photos will be sent for printing. If there is any other reason, can you please cite example.

  • ACE with sticky http-cookies across two server farms issue

    Hi,
    /* Style Definitions */
    table.MsoNormalTable
    {mso-style-name:"Table Normal";
    mso-tstyle-rowband-size:0;
    mso-tstyle-colband-size:0;
    mso-style-noshow:yes;
    mso-style-priority:99;
    mso-style-qformat:yes;
    mso-style-parent:"";
    mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
    mso-para-margin:0cm;
    mso-para-margin-bottom:.0001pt;
    mso-pagination:widow-orphan;
    font-size:10.0pt;
    font-family:"Times New Roman","serif";}
    We need the same sticky http cookie to applied to two server farms (which are actually the same servers but listening on different ports in each farm) to persist sessions to the same real backend server.
    e.g.
    Farm1 (front end HTTP service) - StickyGroup1
    rserver1 - 192.168.0.1:80
    rserver2 - 192.168.0.2:80
    rserver3 - 192.168.0.3:80
    Farm2 (SSL front end authentication service) - StickyGroup2
    rserver1 - 192.168.0.1:443
    rserver2 - 192.168.0.2:443
    rserver3 - 192.168.0.3:443
    We have setup two Sticky Groups (one for each of the farms above) both using the same cookie name e.g. cookieXYZ
    Our service is behind a single virtual server configured as follows (example URL and addresses):
    Virtual Server Configuration
    Virtual server name: www.somedomain.com
    Virtual IP: 2.2.2.2
    TCP/443 (https)
    SSL Termination - Proxy service name: www.somedomain.com (all keys and certs loaded and correct)
    L7 Load Balancing - **inline** rule match HTTP URL:(/AuthenticateMe/).*  Action : Sticky, Group: StickyGroup2, SSL Initiation enabled (www.somedomain.com)
    Default L7 Load Balancing action : Sticky, Group: StickyGroup1
    So normally we would expect users to first hit www.somedomain.com first and therefore Farm1, get cookieXYZ from the ACE (cookie insert is only enabled on StickyGroup1) and then be redirected to www.somedomain.com/AuthenticateMe which matches the inline URL L7 rule which directs the request at Farm2 - at this point we expected the ACE to use cookieXYZ to persist the user to the same real server hit in Farm1 but instead the stickiness doesn't seem to work.
    We suspect that the ACE uses IP:port as the unique value in the Cookie ID and therefore the ACE fails to match the same real host in a different farm because we are using a mix of port numbers across farms. Is this correct? Is there another way of accomplishing what we are after with a different configuration but still the same setup with single VIP and multiple services on the backend servers?
    Any suggestions or solutions appreciated.
    Thanks
    Paul

    The issue is related to the fact that it's not about persistence because there are only "new" services in the backend in SSL, you want to keep the IP address.
    With a little bit of dev, the only way to acheive this is to redirect the user when he has been sent to http and adding a "tag" (cookie / token in the URL), then on the SSL virtual server, when performing SSL offload matching this tag to send to user to the right server. But it will be a 1-to-1 mapping.

  • I have to tell Firefox that I am logging in from "home" every time I log into Facebook. Firefox will not let me unclick ""Send me an email" under Login Notifications in Facebook "My Account" settings. Why? (to both questions)

    I have to tell Firefox that I am logging in from "home" every time I log into Facebook. Firefox will not let me unclick ""Send me an email" under Login Notifications in Facebook "My Account" settings. Why? (to both questions)

    It started last week - I normally use Chrome to play my games in Facebook - but I started getting "Sorry, this feature isn't available
    right now"..... When I used IE..... no problem - a friend said to install Foxfire, which I did, but I made the mistake of having my bookmarks and whatever transferred from Google as it is the browser I used most often and it has all my bookmarks, but
    now it does the same thing when I try to log into Facebook. - I have no problem with any other website.  I deleted both Google and Foxfire and tried to start over - I cleared History and checked all the boxes hoping that this would help - but it did not.
     I can't understand why I can get in with IE, but not Google or Foxfire.  Do you have any suggestions.......
    On Friday, it started working again - and everything was fine.  But on Sunday evening I ran the History Clean in Google and when
    I went to log back in, I couldn't and got the same "Sorry" message and has stayed this way since. 
    I ran a Norton scan of the entire computer, a Hitman scan, a CCleaner scan, ...  all to no avail. Problem still exists.
    I tried to run a restore program prior to the problem, but I am getting error messages like mad.
    there has been two Windows Updates in this time frame and I don't know if this has anything to do with it or not - but my Restore program does not work.
    NYCsDancer -- if its working via Internet Explorer, we can't help you much. Most of the time it has to do with Cookies, or your Java Version. I'd reach out to Google's forums for assistance with Chrome
    https://support.google.com/chrome/?hl=en#topic=3227046
    or Firefox support for assistance with Firefox
    https://support.mozilla.org/en-US/products/firefox
    Or as S.Sengupta said  reach out to the Facebook Help center....
    Entrepreneur, Strategic Technical Advisor, and Sr. Consulting Engineer - Strategic Services and Solutions Check out my book - Powershell 3.0 - WMI: http://amzn.to/1BnjOmo | Mastering PowerShell Coming in April 2015!

  • How can i send multiple sms from my iphone 4

    how can i send multiple sms from my i phone 4

    Turn Group Messaging (instructions in lin that follows) off and send the message to multiple recipients. The result may be dependent on your carrier. If manually keying in numbers rather than using contacts, use the return key after each number. http://support.apple.com/kb/HT5760

  • ICal sends multiple emails for invites and updates to event attendees - HELP!

    Every time I create or send an event in iCal, it sends multiple emails to each attendee (2-3 duplicate emails) with the same event.  So if I have 3 event invitees, they get 3 emails each.  All the emails are sent from the correct account in Apple Mail, and the calendar itself shows only one email address for each attendee, but for some reason the sent folder shows that each person was emailed 2-3 times.  This is causing quite a problem for work, as any invite I send is clogging up inboxes with duplicate and triplicates for each attendee. 
    When I send a meeting acceptance, it only sends one reply, so I have no idea why it's duplicating or triplicating events when new ones are sent out or udpated by me.  I can't delete my calendar without losing important events from clients or what not, so I'm not sure what to do.
    Also notable:
    I am NOT using iCloud calendars as I needed to create a calendar group and iCloud didn't support that.
    My calendar is syncing to an FTP so that people in my main office can view and download my calendar as needed.
    I am on a brand new (not even 2 mos old) MacBook Pro Retina 2013 model, with OS X 10.8.3
    I am on Calendar 6.0
    I can't change/update events on my calendar from one sub-calendar to another once they are created (though I can edit on my iPhone and resync). This is really annoying and I've posted about this before to no avail (thread here: https://discussions.apple.com/message/21646850#21646850 and here: https://discussions.apple.com/thread/3920017?start=0&tstart=0).
    For now (for this thread) I'd like any help possible in getting my calendar to send just ONE email to meeting attendees when I create and/or update an event.
    Thanks!

    I have the same issue.  Did you get a resolution to this?  Whenever I add a new person to the meeting invite iCal always resends the entire invite...it should just send the invite to newly added participants.

  • SharePoint 2013 - SPD Custom Workflow keeps sending multiple emails for a single Task

    I have a workflow triggering on List item created only. There are multiple stages in the work flow and in each stage a single task is assigned to a group of people. Currently group is only having one user i.e. my own test user with a valid email address.
    Workflow was running fine for first 5 runs but now it keeps sending multiple emails for each task multiple times and runs very slow. I have only single workflow in development server with 24GB RAM.
    Enabling the Workflow log in Event viewer does not show any error or warnings. The only clue I see is WorkFlowManager Database table "DebugTrace" having multiple entries showing that WF is trying to send same email multiple times with failed attempts,
    but in reality emails are being delivered as well.
    http://server/site/_vti_bin/client.svc/sp.utilities.utility.SendEmail Retry sending email in xx.xx.xx Status: HTTPRetrying
    http://server/site/_vti_bin/client.svc/sp.utilities.utility.SendEmail Retry sending email in xx.xx.xx  Status: HTTPFailed
    I could not get the exact phrase as I don't have direct access to development machine at work.
    Any help or guidance will be highly appreciated.

    Yes, I have on-premise SP site, and here is the actual log I see in DebugTraces table.
    Message              Level     Name    Category
    Attempt 1 of the HTTP request to 'http://site/collection/_vti_bin/client.svc/sp.utilities.utility.SendEmail' failed with response '<Exception.
    No Status Code>'.              2              HttpRequestFailed          Http
    Attempt 2 of the HTTP request to 'http://site/collection/_vti_bin/client.svc/sp.utilities.utility.SendEmail' will be made in 00:00:06.            
    2              HttpRequestRetrying     Http
    Attempt 2 of the HTTP request to 'http://site/collection/_vti_bin/client.svc/sp.utilities.utility.SendEmail' failed with response '<Exception.
    No Status Code>'.              2              HttpRequestFailed          Http
    Attempt 3 of the HTTP request to 'http://site/collection/_vti_bin/client.svc/sp.utilities.utility.SendEmail' will be made in 00:00:07.            
    2              HttpRequestRetrying     Http
    Attempt 3 of the HTTP request to 'http://site/collection/_vti_bin/client.svc/sp.utilities.utility.SendEmail' failed with response '<Exception.
    No Status Code>'.              2              HttpRequestFailed          Http
    Attempt 4 of the HTTP request to 'http://site/collection/_vti_bin/client.svc/sp.utilities.utility.SendEmail' will be made in 00:00:09.            
    2              HttpRequestRetrying     Http
    Attempt 4 of the HTTP request to 'http://site/collection/_vti_bin/client.svc/sp.utilities.utility.SendEmail' failed with response '<Exception.
    No Status Code>'.              2              HttpRequestFailed          Http
    Attempt 5 of the HTTP request to 'http://site/collection/_vti_bin/client.svc/sp.utilities.utility.SendEmail' will be made in 00:00:13.            
    2              HttpRequestRetrying     Http

  • How to send multiple data for a single element

    Hi All,
    I have a requirement where I have to send multiple data for single element per single transaction. For example
    Id details
    1 abcd
    1 efgh
    1 def
    Now, when I am selecting this ID from database, I have to get all the details in a single xsd like
    <id>1</id>
    ---><details>abcd</details>
    <details>efgh</details>
    <details>def</details>
    Thanks

    Hi,
    The following XSLT...
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:template match="/">
    <xsl:variable name="root" select="/"/>
    <root>
    <xsl:for-each select="distinct-values(/root/entry/id)">
    <xsl:variable name="id" select="."/>
    <entry>
    <id><xsl:value-of select="$id"/></id>
    <xsl:for-each select="$root/root/entry[id = $id]">
    <details><xsl:value-of select="details"/></details>
    </xsl:for-each>
    </entry>
    </xsl:for-each>
    </root>
    </xsl:template>
    </xsl:stylesheet>Will work for a document like this...
    <root>
    <entry>
    <id>1</id>
    <details>detail1</details>
    </entry>
    <entry>
    <id>1</id>
    <details>detail2</details>
    </entry>
    <entry>
    <id>2</id>
    <details>detail3</details>
    </entry>
    </root>Hope this helps...
    Cheers,
    Vlad

  • How to send multiple docs in soa suite 10g ?

    Hi All ,
    I am using Soa Suite 10g (10.1.1.3).
    I had a requirement to send multiple docs for single id. say for example, i have table emp and document and for single empid field i have multiple documents. i need to transform in such a way that details from emp along with multiple documents for the corresponding empid
    in emp table i have : empname , empid, dept, place
    in document table i have : empid1 document1,document2 , empid1 document3,document4
    means for the same emp id , i have two documents rows.
    I dont want send emp details multiple times, but for the single emp details i need to send multiple docs.
    say empid1,empname,dept,place and document1,document2,document3,document4
    i use transformation, multiple docs are not transforming, second details overiding my fitrst transformation.
    plese help me , how can i send multiple docs to another service
    Thanks in advance

    Hi,
    I must say that your explanation of your problem is a little fuzzy. But as far as I understand it, you would need an xsd of your external service with a list of documents per employee.
    The more or less simplest/straightforward way to do it is using a loop in BPEL. Then within an assign in the loop you could do:
    <copy>
    <from variable="inputVariable"
    query="/ns1:a/ns1:b/ns1:c"
    part="payload"/>
    <to variable="ServiceDocumentProperty"
    query="/ns22:Property/ns22:value"/>
    </copy>
    <bpelx:append>
    <bpelx:from variable="ServiceDocumentProperty"/>
    <bpelx:to variable="lServiceDocumentPropertyList"
    query="/ns22:PropertyList"/>
    </bpelx:append>
    I think you could do it as well in a transform, but then you should create a (set of) custom templates that traverses the source list of documents in a recursive way. For some examples you could read this article: http://blog.darwin-it.nl/2013/02/sending-and-saving-emails-in-soasuite.html. Because the difficulty in your case is (as I understand correctly) you have a detail table with 2 documents per row. What would be more logical and simpeler is if you would had 1 document per child-row.
    If you could redesign your source-model into a single document per row, then in the xslt-transform you could do just the for-each construct.
    Regards,
    Martien

  • How to send multiple files by using File Adapter

    Hi Experts,
    I am trying with the scenario by using the File Adapter.
    As per my requirement, I need to send multiple files (like FileA.xml, FileB.pdf, FileC.txt, FileD.html etc) to the Target system.
    I have seen ‘Additional Files’ option, in Sender Communication channel. But I am not sure how to give the parameters, in case if I would like to send the multiple files as mentioned above.
    Could someone please explain about the steps, that I need to proceed further?
    Thanks in advance.
    Sree

    Anand,
    Thank you for your reply.
    My requirement is to send the multiple files like inone.xml, intwo.txt etc. In the Sender Communication channel, I had provided ' inone.xml ' in the File Name field under the "File System Access Parameters" section.
    Next I had chosen "Additional Files" option as Checked and provided ' intwo.txt ' in the field name of "File List".
    After activation, i have provided those two files (inone.xml, intwo.txt) in the Source folder. It is not processing? What could be the problem ?
    Thanks
    Sree

  • Cannot send multiple attachments since 10.5.8 with IMAP

    Have had a consistent issue that Mail 3.6 will not send multiple attachments, regardless of size, since the 10.5.8 update with a IMAP configuration. Under POP, as in Gmail, using Mail 3.6 with multiple attachments is no issue. Using IMAP through my Godaddy Hosted Domains, in some cases it actually is sending mail as verified through webmail "Sent" folder but does not show in Mail 3.6 "Sent" folder. Have verified this through sending from my IMAP Goddady hosted emails to my POP Gmail account accessed via Mail 3.6. Can also send successfully through webmail on Godaddy to any Pop or IMAP account.
    It seems something in the 10.5.8 update has altered Mail 3.6 to impact this functionality. As a business owner this functionality is crucial, may have to switch to Entourage.
    Any suggestions are appreciated.

    That crash is because of a bad result from an OS routine.
    Our best guesses involve corrupt application installs, or corrupt OS installs.

  • How to send multiple customer statements by email using RFKORD11

    Hi All,
    How to send multiple customer statements by email using RFKORD11 program.
    As of now we copied the stanadard program and sending the customer statements by email, one by one.
    if  i execute the z program it will show the customer statement and send mail option.
    if i click send mail it will send that customer statement to the corresponding customer.
    then again i need to click back, it will show next customer statement and click on send mail.
    Pl guide me, if any one worked on this program.
    Regards,
    Mahesh

    Hi .
    You first need to copy that program to Z and make the changes in it. Can you convert sapscript to smartform?
    then you can write a logic to send mail in the loop.
    to send the pdf file
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/mailsendthroughoutputcontrols
    Regards,
    Madhuri
    Edited by: madhuri sonawane on Jun 10, 2009 4:20 PM

  • Sending multiple files

    in file to file. i am sending multiple file with different file name and in target side the same file names should be displayed.help me how to solve problem

    Hi,
    In recevier communication channel we have advanced tab, asam properties we have enable that file name.
    try {
    String filename    = "";
    DynamicConfiguration conf1 = (DynamicConfiguration) container
        .getTransformationParameters()
        .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","FileName");
    filename = conf1.get(key1);
    filename = filename".xml";
    conf1.put(key1,filename);
    return filename;
    catch(Exception e)
         String exception = e.toString();
          return exception;
    regards,
    ganesh.

  • How to send multiple records in file2file and file2db or all scenarios//

    I'm able to send single record for file2file and file2db,
    how to send multiple records in file2file and file2db or all scenarios//
    what should add or make changes for dis.

    1 put Occurance 1 to Unbounded in data type of IR
    2 In the test tag of message mappings in IR,select one node and use "duplicate subtree" in its context menu
    After that,you can download the test data in XML format with the button "save document source"
    for example:
      <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:ZFileDemo xmlns:ns0="http://hand-china.com/mm/po_01">
    - <Item>
      <ItemNo>1</ItemNo>
      <Matnr>2</Matnr>
      <Text>3</Text>
      </Item>
    - <Item>
      <ItemNo>4</ItemNo>
      <Matnr>5</Matnr>
      <Text>6</Text>
      </Item>
      </ns0:ZFileDemo>

Maybe you are looking for

  • Displaying the column values of a wizard-generated form

    Hello, I created a Master-Detail page following the examples in the various Apex guides. The form is not working correctly, unfortunately. When I click the Add Row button a row is added at the bottom of the table. Once I enter data into that row and

  • Enable spawn pages from template

    Hi all, I have a fill-in PDF form (created in Acrobat Pro X) that uses a javascript button to duplicate pages (spawn pages from template).  We got a trial version of LC Reader Extensions ES in order to enable the button to function in Reader.  The pr

  • Is the bumbed MacBook pro the 2012 model?

    Is the bumbed MacBook pro the 2012 model?

  • Sender Schema as ALE#SP

    Hi,   I'm trying an Idoc to file scenario. I'm posting idocs from r/3 to xi. In sxi_monitor it shows the sender schema as ALE#SP. This used to be shown as XIParty earlier. This is not really a problem, since I'm mapping to a file. But I'm just curiou

  • New Franz Ferdinand NOT available at iTMS Canada

    While since Oct. 4 all the iTMS sell the new Franz Ferdinand album, the Canadian store does not. No wonder people download from Limewire etc. Does anyone know what the deal is? I'd spend a lot more money if we had the same tunes as the US or UK store