Cookie domain remains as null even when i do setDomain().

I create a cookie as follows:
Cookie cookie = new Cookie(Constants.cartCookieName, cookieValue);
cookie.setVersion(1);
cookie.setDomain(".sears.ca");
cookie.setPath("/");
int secondsInYear = 365 * 24 * 60 * 60;
cookie.setMaxAge(secondsInYear);
response.addCookie(cookie);
But cookie.getDomain() on the next page always returns null.
I found that doing cookie.setVersion(1) makes this work on Konqueror browser. Is there a similar/any other solution for IE & Netscape?

As far as I know it's because the browsers don't send the domain back. The domain is used by the browser to assist in deciding whether to include the given cookie in the request. It only needs to send the name/value pairs for the cookie in the request. Anything else should not be expected. If you get the cookie name/value, then you can assume that it's within the valid domain and not expired.

Similar Messages

  • Value of Statement becomes null even when the connection is open

    my small program deals with jdbc during which i met with this strange situation.
    i want the value assigned to an instance of Statement (say 'st') for future use. So i declared st' as a class variable. and the variable is assigned with a value inside try-catch block which is inside the constructor. But when i tried to access it from outside it seems to be null. i ve made it clear by giving two print statements INSIDE and OUTSIDE the try-catch block. More over u can notice that the
    value of an integer variable remains unaltered INSIDE and OUTSIDE the try-catch block. Wats wrong with my coding? Is there anything
    special regarding the 'st' variable which is a reference of Statement interface. BUT WHEN THE DATABASE WAS MS Access, THE
    VALUE OF 'st' WAS EXACTLY THE SAME INSIDE AND OUTSIDE THE try-catch BLOCK(i tried it also by making appropriate changes in the jdbc part).
    the output in both the situation is copied here.
    please correct me.......any help welcomed.
    my program
    import java.sql.*;
    public class MyStatement
         Connection con;
         Statement st;
         ResultSet rs;
         int test=0;
    public MyStatement()
    try
                             Class.forName("com.mysql.jdbc.Driver").newInstance();
    Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/mysql", "root", "passes");
    Statement st = conn.createStatement();
    test=111;
    System.out.println("value of statement INSIDE try-catch block: "+st);
    System.out.println("value of test INSIDE try-catch block: "+test);
    catch (Exception e){System.out.println("sql "+e);}
    System.out.println("value of statement OUTSIDE try-catch block: "+st);
    System.out.println("value of test OUTSIDE try-catch block: "+test);
    public static void main(String args[])
    new MyStatement();
    }

    Try this:
    public class MyStatement {
        Connection conn;
        Statement st;
        ResultSet rs;
        int test = 0;
        public MyStatement() {
            try {
                Class.forName("com.mysql.jdbc.Driver").newInstance();
                conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/mysql", "root", "passes");
                st = conn.createStatement();
                test = 111;
                System.out.println("value of statement INSIDE try-catch block: " + st);
                System.out.println("value of test INSIDE try-catch block: " + test);
            } catch (Exception e) {
                System.out.println("sql " + e);
            System.out.println("value of statement OUTSIDE try-catch block: " + st);
            System.out.println("value of test OUTSIDE try-catch block: " + test);
        public static void main(String[] args) {
            new MyStatement();
    }

  • Why does LV not close, but remains in memory, even when it has stopped running?

    Whenever I run LV7.1 on this Panasonic Toughbook CF18 (XP pro sp3) after stopping or closing LV, it remains open on the toolbar and in the task manager; the applications window indicates "not responding" and I must close it manually. the Processes window shows about 25-30k memory usage for each instance. If I run an exe again, each time it leaves another program open on the toolbar and in memory.  It does the same thing whether I'm running an exe written in LV, or just opening the LV71, even without loading or running a vi. I suspect it is a setting somewhere in windows setup but I don't know what to look for.
    LV has done this ever since it was installed on this machine, several years ago, and can be annoying when I do a lot of work with it.  Is there somthing I can do to make LV close completely when exiting?

    Hey Rikard,
    So, what you are seeing is that each VI that you open in the development environment remains open in memory even after you close the VI? When you manually close a VI, you still see it located in task manager and it is listed as not responding. The only way you can release the memory and remove it from task manager is to manually 'end task?' This is also true for executables, even though you close the .exe it still remains in memory? Have you seen this same behavior on a different computer, or does it seem unique to this particular machine/setup? Does this happen with any other programs?  Perhaps some screen shots of your desktop and task manager would be helpful in clearing up what is actually happening.
    Hope this helps.
    -Ben
    WaterlooLabs

  • When downloading apps updates, none of the updates actually complete, they remain 'processing file' even when the down load looks complete. Any help?

    This problem is happening when I run iTunes, regardless of whether any devices are connected.
    And none of them can be deleted from the progress list either...

    This problem is happening when I run iTunes, regardless of whether any devices are connected.
    And none of them can be deleted from the progress list either...

  • Podcasts remain on Ipod even when unticked on itunes

    Does anybody know how to stop podcasts that i have listened to and then unticked on itunes from appearing on my ipod
    thanks

    Connect your iPod. Go to Preferences and then iPod. There is an option that says "Only update checked songs" This should take care of your issue.

  • Hard Drive Light remains on even when system is powered off

    HP xw8600 Workstation running XP SP3
    In the past couple of weeks I am getting a lot of blue-screen errors with varying error codes, mostly pointing to problems with the C: drive. But what troubles me is that my hard drive activity light remains lit constantly, even when the system is powered off. The only way to make the light go out is to physically unplug the power cord from the computer. As soon as I plug the power cord back in, the HDD LED lights up.
    I have Googled, Yahooed, and Binged this problem to death, and gotten nothing but pages and pages of why the hard drive would be busy when the machine is powered up. But powered down?
    I ran HP's hardware diagnostics (found no problems, it never does) and have even disconnected the hard drive and moved it to another identical box (we have about 25 xw8600 boxes) and the problem did not follow. The HDD LED on this box remains lit with the power off and no hard drives connected.
    I should note that the power light functions properly, I have checked the wiring and it's not backwards.

    Hello WAVYTV, The symtoms you describe sound suspiciously like a faulty motherboard.
    There may be a possibility that you could also have a faulty power supply.
    Please click the White Kudos star on the left, to say thanks.
    Please mark Accept As Solution if it solves your problem.

  • I would like to delete a google pref cookie that re-establishes itself instantly even when I am on a blank new tab that looks like this: PREF ID=eb1514ca52c9d

    I would like to delete a google pref cookie that re-establishes itself instantly even when I am on a blank new tab-- it looks like this:
    name: PREF
    content: ID=eb1514ca52c9d753:TM=1403658310:LM=1403658310:S=CQKzVsy8LHiPFFmX
    domain: .google.com
    path: /
    send for: Any type of connection
    it might be helpful just to know what it's doing, since I don't have any google/gmail/youtube accounts...

    What page are you using for your new tab page? Is it completely blank or is it the page with the thumbnails, but with the thumbnails hidden (in that case, there usually is a grid-like icon on the upper right side of the page)?
    You can check the current setting here:
    (1) In a new tab, type or paste '''about:config''' in the address bar and press Enter. Click the button promising to be careful.
    (2) In the search box above the list, type or paste '''newtab''' and pause while the list is filtered
    (3) Double-click the '''browser.newtab.url''' preference and enter your preferred page if it isn't what you want:
    * ''Page thumbnails (default)'' => about:newtab
    * ''Blank tab'' => about:blank
    * ''Built-in Firefox home page'' => about:home
    * ''Any other page'' => full URL to the page
    Press Ctrl+t to open a new tab and verify that it worked. Fixed?
    But... extensions can override this setting. If you are getting a page other than the one you specified, that could be explanation.
    Any luck?

  • I turned off my phone and when I turned it back on, all my apps were deleted. I tried to reinstall my apps, but it wouldn't let me. My storage still remained the same even though, all my apps were deleted. How can I get my apps back?

    I turned off my phone and when I turned it back on, all my apps were deleted. I tried to reinstall my apps, but it wouldn't let me. My storage still remained the same even though, all my apps were deleted. How can I get my apps back?

    Hold the home and power button down until your phone restarts. If that doesn't work, backup and restore using iTunes.

  • How to set a foot in a scrolling page site, that it remains visible even when scrolling, using PC

    how to set a foot in a scrolling page site, that it remains visible even when scrolling, using PC

    Hello,
    Please select the footer items and Pin them to the bottom like the screenshot below.
    Regards
    Vivek

  • Safari allows 3rd party cookies and all cookies even when prefernces are set to "never allow" with Mac os 10.6.8

    safari ALWAYS allows 3rd party cookies and all cookies even when set to "block cookies: always" and "from 3rd party and advertisers."  I have removed the website data, emptied the cache, reset safari, erased the history and it STILL dumps cookies.  (For example, if I go to the usgov weather website only I end up with 11 cookies, the top one being "addthis.com" listed as cashed in local storage.  But didn't I just empty the cache... multiple times??? Is my Safari application "broken" or "corrupt."  Can the application be renewed so that it actually does what it is commanded to do?

    Not using any extensions, Andy.
    Allowed a guest account and tested that.  Lots of cache/cookies showed up for my "guest" that on face value, appeared 3rd party:  the familiar "addthis.com" cache and others including a facebook cache and I did not, nor have ever, participated in facebook. But it could be that the "trusted" site my virtual guest visited had a relationship with facebook such that my COMPUTER "friended" facebook even though my guest and I most certainly would have declined the invitation :-)  But what I really don't get is why washington post cookies keep showing up every single time.  Isn't that the absolute definition of 3rd party cookies?!
    forgive my rant.
    On the other hand, when I logged out as guest, all data was automatically deleted, and when I relogged in as guest, it appeared that all the data, including cached data, had indeed been deleted.  But when I relogged in as myself, the same old garbage reappeared in the cache and cookie bin. The fact is, there appears to be no such thing as truly and completely emptying ones cache, resetting ones browser, or deleting ones cookies. They are here to stay.
    (And, oh yes, I have tried logging out, turning off and on the computer right after performing emptying tasks, etc.)

  • Now getting Google cookies even when "always block" is chosen

    Since the last update, I now get Google cookies even when "always block" might be chosen in preferences. I realize I might still get cache under that setting, but I should not get anyone's cookie. I keep fewer than 20 essential cookies and always delete all other cookies I can get from visiting sites.  (would you believe one site I visited dumped over 60 cache and cookies on me just by visiting a single home page?)
    Is Google doing evil things and bypassing no cookie preferences yet AGAIN?

    Removal/prevention of Google cookies:
    http://www.google.com/privacy_ads.html
    But it can be hard to be rid of Google for ever:
    http://www.bbc.co.uk/news/magazine-18777671

  • I have two airport extremes, one acting as amodem and the other operating in bridge mode.  The extremes are connected using ethernet, but remain connected even when I disconnect the Cat5a cable. How do I know if they are operating wired or wirelessly

    I have two airport extremes, one acting as a modem and the other operating in bridge mode.  The extremes are connected using ethernet, but remain connected even when I disconnect the Cat5a cable (I did this to check that the 100 feet of Cat 5a cable connecting them was working). How do I find out if they are operating wired or wirelessly?  I want to know as I assume I will get much better speeds if they are wired.

    Hi Bob, many thanks for the prompt response.  I think I did what you suggested, but you're the expert so I have sent over a few screenshots.  The extreme in question is High Birches Home Office (the rest of the network has been in place and working well for some time).  My new home office is going to be in the garden, circa 100 feet from the main house.  I have installed armoured Cat5e cable down to the shed that is going to be adjacent to the home office once built and situated the High Birches Home Office Airport Extreme there temporarily.  Everything works well, so I was surprised when I unplugged the ethernet, that it still worked.  I also tested the ethernet cable by switching off my laptop's wifi and unplugging the cable from the airport extreme and directly into the laptop and that worked ok.
    If the screenshots below (I did every Airport utility tab for the High Birches Home Office) don't tell you anything more, then the set-by-step instructions would greatly appreciated so I can ensure I completed the steps correctly. 
    Many
    Thanks, Greg.

  • Why does Safari still accept cookies, even when I put Block Cookies "Always"

    Why does Safari still accept cookies, even when I put Block Cookies "Always",? There are always a list of every website with cookies. Is that just a record of what could've been accepted or its a bogus feature that still accepts regardless of what feature is on?

    Apple has rolled over users since OS X 10.6.8 when this issue first appeared.
    If you want a browser that actually CARES about it's users, then install Firefox, it's the only one that does.

  • Anyone have the problem I'm having with the Safari collecting cookies even when I'm not on a website?  I cleaned everything out and checked several times.  Each time cookies were added that I've never seen with my older version of Safari.  I have the bloc

    Anyone have the problem I'm having with the Safari collecting cookies even when I'm not on a website?  I cleaned everything out and checked several times.  Each time cookies were added that I've never seen with my older version of Safari.  I have the block third parties and advertisers but I don't think it works.  Here's a sample of what is popping up:  247realmedia.com, 2mdn.net addthis.com, admeld.com, adsafeprotected.com, adsonar.com, bit.ly, bluekai.com, bluelithium.com, bluetoad.com bondware.com.......... over 100 things without a clue where they are coming from.  Especially since I'm not on any webpage!  How do I report a bug?  Is there a way to fix this?  

    Firefox + NoScript, BetterPrivacy, Ghostery, AdBlock Plus, Click&Clean helps.
    Hidden Flash cookies are stored in "Macromedia" Folders on your computer, can delete using the free Easy Find, but need to reinstall Flash again here
    http://www.macupdate.com/app/mac/11076/easyfind
    http://get.adobe.com/flashplayer/
    OnyX run afterwards All the cleaning and maintenance steps followed by a reboot, followed by a Disk Utility erase free space.
    http://www.titanium.free.fr/
    CCleaner is in beta for OS X, can combine the cleaning and secure erase in the same steps if properly configured.
    http://www.piriform.com/mac/ccleaner
    Ideally, to surf XXX sites, one should use a virtual machine software like the free VirtualBox and a ISO of Linux like MacBuntu,
    https://www.virtualbox.org/
    http://www.oslike.se/
    comes with Firefox and Flash is available in the Ubuntu Software Center, create a "snapshot" of this virtual machine to revert back too after surfing. This dumps everything hidden or malware related in the guest OS, scrub the drive if you wish with Disk Utility Erase free space option.
    HTML 5 has introduced a whole new range of tracking ability, you can search for the details online.
    Flash cookie, everycookie, HTML cookies. Google has trackers all over the internet, they record your computer info and all your searches, ISP's record all your IP traffic and keep it for a year, cell carriers track your location via tower and signal triangulation (even non-GPS/smartphones) and keep the results for 6 months and both turn over everything to governments. In fact Uncle Sammy has NSA backrooms on the Internet backbone capturing the traffic in real time.
    http://yro.slashdot.org/story/11/03/26/179257/German-Politician-Demonstrates-Ext ent-of-Cellphone-Location-Tracking
    Turn off Java. Run with little or no scripts. (NoScript)
    SSD drives can't be securely erased as this would wear them out prematurely, the government and police have a portable device from Cellbright they can attach to over 3000 phones and grab the data and password with.
    http://hardware.slashdot.org/story/11/02/17/1911217/Confidential-Data-Not-Safe-O n-Solid-State-Disks
    http://www.thenewspaper.com/news/34/3458.asp
    Creepy program track you by pictures you took
    http://www.thinq.co.uk/2011/3/30/creepy-app-warns-end-privacy/
    Apple trying to patent new spyware
    https://www.eff.org/deeplinks/2010/08/steve-jobs-watching-you-apple-seeking-pate nt-0
    http://betanews.com/2011/04/20/apple-tracking-location-of-ios4-device-users-rese archers-say/
    Each computer has a unique ID and a MAC addrress on file with Apple, Java gives up this information with a simple script on websites
    Also look here and freak out.
    http://www.whatsmyip.org/more/
    You can't win, the government, advertisers, social sites, search engines and devices makers are all in cohoots to profile everyone.
    Live off the grid and have your freedom or tell everyone your business and let them mold you, there is no "in between", try as you may they just come up with new stuff to watch you, through your web cam, via the hidden microphone and even can turn on some cell phones microphones too.
    You may be paranoid, so is the government, and they got more money, power and resources at their disposal to act on it.
    Erase the whole hard drive and reinstall, if you can't do that, trash the entire machine and go read a book.
    https://discussions.apple.com/message/16276201#16276201
    (ps. that was fun, enjoy the paranoia because they ARE watching you.)

  • Ken Burns effect remains even when turned off

    I'm having huge problems viewing slideshows with iPhoto 5. I cannot get the Ken Burns effect off, even when it is not selected, and when I select a small number of photos to show, and click view slideshow, the music starts, but only the first photo appears. Has anyone else seen these problems? I've tried replacing the iPhoto preferences, but that did not help. Thanks.

    Thank you for responding. I guess I did not pay strict attention to turning off the Ken Burns effict in both places. One other thing that made it peculiar was that the first slide would display and then it would wait for several seconds before showing the next slide even though I had set it to display each slide for only 2 seconds. I'm wondering why that was? Could Spotlight have been indexing the drive and slowing things down? It seems OK now. Also, strangely still, when I click on the red X to close the window of iPhoto, then entire application quits. The whole thing is acting quirky. Comments most welcome. Thanks again.

Maybe you are looking for

  • Problem saving .dv file to external hard drive

    Hello - I'm trying to copy an old VHS tape to DVD. VCR to camcorder to iMovie 4.0.1 and edits all went smoothly. To create the .dv file I did File > Share > QuickTime tab > compress for Full Quality DV and created a 5.68 GB file movie1.dv - all OK. I

  • How to change the batteries on a palm m125 without having to do a hard reset

    Some palm m125's are defective meaning that when one changes the AAA batteries one is presented with a no way out question on whether yes to hard reset or no to not hard reset, yes it's true that what i mean by no way means that even a soft reset wil

  • Excise invoice clearing method for customs

    Hi Gurus     this is chandu  , how to clear the excise invoice for imported materials is there  any transactional code to plz tell me  Example: if suppose i'm importing a material from USA so how can i clear the customs duty to make a GR at my compan

  • User moves mouse out of dial while turning it

    I have a user interface problem. I'm using dials to control scrolling and zooming in a graph. But it's very easy, as a user, to click in the dial and start dragging to turn it, but end up outside the dial. And then the dial never gets the Mouse Up ev

  • How to use this API?

    Hi all, I have a doubt, I have to test an app which works with the API JavaPOS, I have downloaded it but now I don�t know what to do with it. I mean, I don�t know how I can import its classes and such things for it to be recognize by the java app. An