Applets, URLConnection, IPv6, and Cookies

The web application I'm working on does part of its cookie authentication by comparing the REMOTE_ADDR header to your cookie, which works fine for browser interaction. But we have a few applets that communicate directly with the server. In mixed IPv4/IPv6 environments, the browser (naturally) communicates using IPv6, but the Applets use IPv4 by default, causing the REMOTE_ADDR comparison to fail (the server expects an IPv6 address).
I've had mixed results with setting java.net.preferIPv6Addresses to TRUE in my Java settings. This appears to work on my machine, but not on my QA's machine.
I also tried setting this property programmatically and then signing the applet, but that didn't appear to work at all.
The alternative I came up with was to find an IPv6 address via InetAddress.getAllByName(host), and use that for my URL instead of the hostname. This reports the correct IP address in REMOTE_ADDR, but since I'm not using the same name as in the browser, my browser cookies don't come along for the ride. I've tried getting the cookies by opening a connection to the correct hostname and reading connection.getRequestProperties() or connection.getHeaderField("Set-Cookie"), but I don't get any information back.
Does anyone have any ideas as to how I can either
a) Force the applet to connect using the correct IP stack, or
b) Grab the cookie from the browser
Thanks.

try
URLConnection.setUseCaches(false)
setUseCaches
public void setUseCaches(boolean usecaches)
Sets the value of the useCaches field of this URLConnection to the specified value.
Some protocols do caching of documents. Occasionally, it is important to be able to "tunnel through" and ignore the caches
(e.g., the "reload" button in a browser). If the UseCaches flag on a connection is true, the connection is allowed to use
whatever caches it can. If false, caches are to be ignored. The default value comes from DefaultUseCaches, which defaults to
true.
or try to delete old cookies by calling Cookie.setMaxAge(0)
in your jsp

Similar Messages

  • How to  � applet URLConnection � to the same HttpServlet session.

    Hi my applet needs to upload some data to be appended to previous uploads every few minutes.
    I tried with
    session = request.getSession (true);
    sessionId = session.getId ()
    pass sessionId to applet and
    On the applet side
    URL url = new URL (serverURL +"?JSESSIONID="+sessionId);
    or
    URL url = new URL (serverURL +�?�+sessionId);
    It is not working
    Any help is appreciated.

    Hi tolmank,
    I tried
    URL url = new URL (serverURL +":JSESSIONID="+sessionId);
    I get
    java.io.FileNotFoundException: http://localhost:8084/RACServer12/RACServlet:JSESSIONID=534E1D0B183BC12CEB36EBB8371720CF
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1131)
    at client.UpLoadThread$1.run(UpLoadThread.java:76)
    at java.lang.Thread.run(Thread.java:595)
    Can�t find the session
    Then I tried
    URL url = new URL (serverURL +";JSESSIONID="+sessionId);
    Can�t find the session
    Then I tried
    Applet side.
    con.setRequestProperty("Cookie", sessionId);
    Can�t find the session.
    Any help is appreciated.

  • Safari 5.1, OS 10.6.8 and cookie controls

    Ok, I know there are numerous threads here in the Mac Safari forum regarding the issue of Safari 5.1 and cookie control. I just thought I would start my own thread instead of continuing on something else.
    I am using Safari 5.1 and 10.6.8. I waited for a bit to update to 5.1 (did it this week), giving it since its debut on July 20th. I too am experiencing the lack of cookie controls. The three settings that exists do not seem to do what they say except that they always allow cookies.  To update from Safari 505, I downloaded the installer from Apple downloads instead of using SU function. 
    Has anyone read something that Apple knows of this issue? 
    Since installing Safari 5.1, I have done the last security update as well.
    I remember reading that reinstalling the 1.1 version of the 10.6.8 combo would replace Safari 5.1 with 505. But, has anyone tried that? Will Safari 5.1 show up in software update as well as the last security update? I am wondering if I reapply that combo if it will undo the last security fix as well (since I am assuming software update will still see the receipt for the previous ones and not call for them to be redone).
    If all cookies are coming through, isn't this a serious bug?  I have been resetting safari often to wipe them out, but they reoccur switftly.  I have to MBP's and am seeing the same behaviour on both.

    I'd use that terminal command - takes seconds (and a restart) + no download. But otherwise yes - the 10.6.8 v1.1 then the update & anything else software update picks up (not safari, obviously )
    Some people happily get a copy of just the safari 5.0.5 application & use that, since apparently it works, although I'm not sure what cookie function you'll get (easy enough to see). You'd use Pacifist to extract it from the 5.0.5 installer package, or grab it from a backup.
    Although you'd hope software update would catch the security change - I'm not sure if the combo would overwrite the new or not... on the one hand, it's newer, but on the other, it sure over-wrote safari 5.1 when i checked it... so better to be sure, I haven't checked since that update.
    If you look at the files in /System/Library/Keychains/ afterwards - if EVRoots.plist, SystemRootCertificates.keychain, and SystemTrustSettings.plist are all dated 23 April 2011, the combo rolled them back - if they're later... it didn't.
    Apple do know, since bug reports come back as 'duplicate of...' - but  there's no public info to my knowledge.
    How much of a security issue is this? Should I worry about it, or just leave it until they update to fix?
    more privacy than real security, I'd say - although there are add-ons to manage cookies.

  • I can not view ANY videos on Vimeo, I have 'reset' the Ipad, original IOS 5, cleared the history and cookies, I have changed the DNS number to 8.8.8.8, I have worked on this for 2 days and still can't find a fix, HELP!!

    I can not view ANY videos on Vimeo, I have 'reset' the Ipad, original IOS 5, cleared the history and cookies, I haves changed the DNs number to 8.8.8.8, I have worked on this for 3 days now, HELP!!!!

    Try a reset: Simultaneously hold down the Home and On buttons until the device shuts down. Ignore the off slider if it appears. Once shut down is complete, if it doesn't restart on it own, turn the device back on using the On button. In some cases it also helps to double click the Home button and close all apps BEFORE doing the reset.

  • How do I get Firefox to show the proper font and layout of a site when it keeps loading an older version of that site? (I have cleared cache and cookies already)

    We are having a new website developed and my designer has made changes to it. Despite clearing the cache and cookies, the fonts are not showing up as the actual fonts. Also, the form fields at the bottom are extending beyond the border on the right side of the box on my screen, but this does not happen for other people using Firefox - it is only on my computer.
    I AM ON A MAC.
    I received a suggestion to reload the page and bypass the cache with:
    * Press "Cmd + Shift + R" (MAC)
    BUT - this did not work.

    You can reload the page and bypass the cache with:
    * Press and hold Shift and left-click the Reload button.
    * Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    * Press "Cmd + Shift + R" (MAC)
    See [[Keyboard shortcuts]] and [[Mouse shortcuts]]

  • How do I clear cache and cookies on my ipad

    How do I clear cache and cookies on my ipad?  I was told to do this when I was trying to download ebooks to ibooks and kindle

    Settings/safari/clear history;clear cookies and data

  • In IOS 7 some web pop ups freeze, I can only resume safari if I delete data and cookies from the safari settings

    I recently installed IOS 7 and I getting used to the new feel.  However, I have encounted a problem at least three times now.  If I am shopping and a web message pops up, such as "you must select size before quantity" or "you have exceeded the number of items" there is a box that displays "ok" for you to acknowledge the mistake and continue.  In IOS 7, the pop ups freeze, I am not able to click "ok" and make the dialog box go away.  My only solution so far is to go to settings -- safari-- clear data and cookies.  Any help or insight would be appreciated!

    My iPad also experiences this.

  • Same thing is happening to me. Adobe has not responded to anyone about this error. It appears that Abobe XI is not compatible with IE 11.  I do not get this error when I use Chrome or Firefox. Only IE 11 does this. I have tried clearing cache and cookies.

    Same thing is happening to me. Adobe has not responded to anyone about this error. It appears that Abobe XI is not compatible with IE 11.  I do not get this error when I use Chrome or Firefox. Only IE 11 does this. I have tried clearing cache and cookies. I even uninstalled and re-installed IE 11. It is still doing it.  I am surprized that a company like Adobe would just ignore our posts and leave us hanging this this.
    Error message is FAILED TO GET DISPATCH FROM IBRWSR2.  Then when you click on it the next error message says:  PHTML IS NULL. You have to click this error message twice and then the PDF finally loads. Happened every time
    Does anyone have a solution since Adobe will not respond?
    As a last resort I will try uninstalling the Adobe Reader XI and install Adobe Reader 10 instead. It seems to work ok. But when I try to install version 10 the Adobe site tries to install XI.  Any ideas?
    JimP08758

    It worked just fine for me.
    Many site issues can be caused by corrupt cookies or cache.
    * Clear the Cache and
    * Remove Cookies '''''Warning ! ! '' This will log you out of sites you're logged in to.'''
    Type '''about:preferences'''<Enter> in the address bar.
    * '''Cookies;''' Select '''Privacy.''' Under '''History,''' select Firefox will '''Use Custom Settings.''' Press the button on the right side called '''Show Cookies.''' Use the search bar to look for the site. Note; There may be more than one entry. Remove '''All''' of them.
    * '''Cache;''' Select '''Advanced > Network.''' Across from '''Cached Web Content,''' Press '''Clear Now.'''
    If there is still a problem,
    '''[https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode Start Firefox in Safe Mode]''' {web link}
    While you are in safe mode;
    Type '''about:preferences#advanced'''<Enter> in the address bar.
    Under '''Advanced,''' Select '''General.'''
    Look for and turn off '''Use Hardware Acceleration'''.
    Poke around safe web sites. Are there any problems?
    Then restart.

  • I have an IPone 4, there is an add video for Capital one that keeps coming up on its own... ive deleted my history and cookies and this video keeps taking over my phone. how do i get rid of it? the video is of a man with a puppet and the puppet is singing

    i have an IPone 4, there is an add video for Capital one that keeps coming up on its own... ive deleted my history and cookies and this video keeps taking over my phone. how do i get rid of it? the video is of a man with a puppet and the puppet is singing a song while he is checking his phone. how do i get rid of it????

    If it happens again the make sure that you aren't suppressing website colors.
    Make sure that you allow pages to choose their colors and that you haven't enabled High Contrast in the Accessibility settings.
    *Tools > Options > Content : Fonts & Colors > Colors : [X] "Allow pages to choose their own colors, instead of my selections above"
    *https://support.mozilla.org/kb/Options+window+-+Content+panel
    *http://kb.mozillazine.org/Website_colors_are_wrong
    *http://kb.mozillazine.org/Websites_look_wrong

  • My desktop computer crashed and I purchased a new laptop. I was able to salvage the hard drive and files. Can I pull my bookmarks and cookies from the old hard drive and install them on the new computer with FireFox installed?

    I have saved the entire contents of the failing hard drive on an external hard drive. I need to know where the bookmarks and cookie files are loacated and where they need to go on the new system.
    Thank You

    http://support.mozilla.com/en-US/kb/Recovering+important+data+from+an+old+profile
    Your old Profile is located here in Vista & Win7: <br />
    ''drive'':\Users\''Windows login user name''\AppData\Roaming\Mozilla\Firefox\Profiles\''profile_name''

  • I can't get my iphone 5. Ios 7, to accept cookies. I have set the 'block cookies' field ti either never or from third parties. I have cleared history and cookies and data, restart the iphone. Please help...

    I upgraded my iphone to os 7 two days ago. However, now it cant accept cookies at all. I have set field 'block cookies' to never or from third parties. I have cleared history and cookies, then reboot my iphone. I have tries to force close all applications. Still, cant accept cookies. Please help...

    Make sure you have the latest iTunes version installed and hopefully you have the most recent backup of your iPhone.  Do a DFU restore.  While it's plugged in to your computer, press and hold the Home and Sleep/Wake buttons together until the screen is off.  When the screen's off, release only the Sleep/Wake button and keep holding down the Home button.  Wait until you see in iTunes on your computer to show that it detected it in recovery mode.  When it does, proceed with the restore.  It will be restored and updated to the latest iOS 7.0.2.  If you have a backup, restore from that backup once iOS 7.0.2 is successfully installed on your iPhone.
    If your iPhone still won't activate, I agree with gail, you will have to get in touch with that developer.

  • I can go to every other website except for facebook even if i use other browsers all i can see is 404 Not found or HTTP 500 Error since yesterday I tried reinstalling clearing history and cookies enabling them make sure that my firewall permits me to acce

    I can go to every other website except for facebook. I try every other browser in my computer but the only thing I can see is HTTP 500 error and 404 Not Found. I tried clearing cache history and cookies, enabling cookies, checking my modem, make sure my firewall permits me to access this web and even pt 's' in front of 'http' but it still dosent work. I can go to facebook with my dad's laptop and my handphone but not with this computer, why?
    == URL of affected sites ==
    http://www.facebook.com

    Problem Resolved!
              I found out that I had 'http' instead of 'httpd' in the statement where I
              registered my servlet, SqlServlet.
              Now, I am having difficulty with hot deployment. The server is returning
              error 404.
              

  • How do I backup web browser prefs, bookmarks, and cookies?

    I've got the hang of backing up files to an external hard drive. Not too complicated.
    This weekend I'm installing a new hard drive so I've got to rebuild my desktop from scratch and re-import all my files from my external drive.
    I use Firefox and I'm loaded up with bookmarks, preferences, and cookies for all kinds of sites I visit like Amazon.
    Can all this be backed up just like files and folders? How do I backup bookmarks, preferences? And can cookies even BE backed up? Or do I have to re-enter passwords and such to all these sites I visit and start from scratch?

    Hi, John. I have no experience using SuperDuper to make anything but a bootable clone, so I can't advise you on the ins and outs of using sparseimages. The one thing I would caution you about is that a sparseimage combines everything that's included in it into a single file, and if that file somehow gets corrupted and won't open, the contents may all be lost.
    The great advantage of a regular clone over any other backup method, even when you aren't going to clone it back to your internal drive, is that every file in the clone is exactly where it was on the original: you don't have to keep track of where to copy each file back to. Just drag-copy it from wherever it is on the clone to exactly the same place on the reconstructed-from-scratch internal drive. But in the four years I've been using OS X, I haven't tried the kind of manual, piece-by piece restoration of essential data from a backup that you're contemplating, and I don't know what obstacles you may run into. My guess is that incorrect permissions will figure largely in whatever trouble you encounter, but permissions are still a dark mystery to me: I'll be no help to anyone with a permissions problem.

  • I'm having to clear cache and cookies daily to have certain favorite websites appear normally - why does that intervention only work for a short period?

    I'm having to clear cache and cookies from the tools menu sometimes 2-3 times daily in order to make certain websites appear normally. The websites will have mostly script, which will be placed in columns, and very little in the way of graphics, maybe just a still picture of two. After I clear the cache and cookies, the sites go back to normal, but maybe after a few hours when I go back to the website it will re-appear as described above. The url below is the most commonly affected but it also happens on others like Yahoo news.

    In order to uninstall a possibly unwanted extension, please do the following:
    #From the Firefox window click the Firefox button at the top left and select ''Add-ons'', or, if the Firefox button is not shown, click the ''Tools'' menu and click ''Add-ons''.
    #Once the Add-on Manager has opened in a new tab, click the ''Extensions'' button on the left side of the window.
    #You should now see a list of your installed extensions on the right side together with buttons on the right side of each extension.
    #To remove an extension from Firefox, simply click the ''Remove'' button on PDF Viewer (what is this?). You should see a message that informs you about the successful removal of the add-on.
    #Note that some add-ons require a Firefox restart to be removed completely. To perform a Firefox restart after the add-on removal, click the ''Restart now'' link in the message.
    You can find further information about uninstalling extensions in the following articles:
    [[Disable or remove Add-ons]]
    [[Remove a toolbar that has taken over your Firefox search or home page]]

  • How do i hide my history and cookies not erase but hide so no one can erase their steps such as kids

    How do I hide my history and cookies so that they cannot be erased by kids or others using my computer. Or can i lock it somehow so that they cant be erased. Signed computer illiterate...

    You should be able to copy iTunes purchases (which should include PDFs in the iBooks app even though they aren't purchases) off the iPad to your computer's iTunes via File > Transfer Purchases.
    On Windows 7 your backup should be stored under :
    \Users\(username)\AppData\Roaming\Apple Computer\MobileSync\Backup\
    But without restoring onto a device you probably won't be able to make much sense of the backup files.
    If you want to copy off photos that were originally synced from a computer you will need a third-party app such as Simple Transfer which can copy them off via your wifi network. But as photos are 'optimised' when they are synced to the iPad, any that you then copy back to a computer may not be exactly the same as they originally were on your computer
    There is also this user tip for recovering your library from a device : https://discussions.apple.com/docs/DOC-3991

Maybe you are looking for

  • HT4623 can no longer access messenger on ipod touch 3

    can no longer access messenger on ipod touch 3 ???

  • Transport in BI 7.0

    HI Experts, i need to clarify a question for a transport in BI. I am transporting some objects from the dev. system to the Qsystem. But some objects there are inactive. I will want to know if before transporting the objects i should first of all repl

  • How do i transfer all my old stuff from g4 to my new macbook pro

    Hi there, All my itunes songs, gigabytes of pics and all my other info is still on my old g4, it does have ethernet. I want to get all my stuff onto my new mac book pro which will be here in a week or so. obviously without using rw-cds if i can help

  • SAP LPO (supported or phased-out?)

    We are evaluating implementing SAP LPO. Own the licenses. Is LPO supported or phased-out product by SAP? Is any functionality of LPO migrated into ECC and APO? What is the typical time frame to implement LPO? We have 18 manufacturing sites. We use EC

  • Retrieving Data from SQLite and make link with the ID of the retrieved data?

    Hello, first of all sorry if my english is bad as im from Mexico. I using HTML/Javascript/SQLite, and im having an issue while retrieving data from SQLite, all my querys work right, but when i try to select an Id, the Name, Firstname, and Lastname an