gigebyte / cookies

Automatically exported from code.google.com/p/cookies
0 stars 0 forks source link

Storing in IE7 on localhost #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Windows, IE 7, localhost

Cookie do't storing for 2.0 version.

Resolving:
1----------------------
    defaultOptions.path='';
    defaultOptions.domain='';

2---------------------- in var assembleOptionsString = function(options)
------------------------------------------------------------------------
        return (
            (options.hoursToLive !== 0 ? '; 
expires='+expiresGMTString(options.hoursToLive) : '') + 
            ( options.path ? ('; path=' + options.path) : '') +
            ( options.domain ? ('; domain=' + 
options.domain) : '') +
            (options.secure ? '; secure' : '')
        );

==========================================
!
Also:
Is uncomfortably store Cookie on short time.
For example, on 1 or 5 seconds.

Original issue reported on code.google.com by it3...@gmail.com on 31 Oct 2008 at 2:27

GoogleCodeExporter commented 9 years ago
FWIW, I have found this problem too.  In fact, the set method will fail with 
any 
single word domain name (e.g. localhost, myMachine, etc) on any browser that 
supports the Cookie standard. I have verified this problem in both IE 7 and FF 
3.

I think this is because the cookie standard requires such entries to have a '.' 
added to it.  This means that a single word hostname gets translated by the 
browser 
to be .name (e.g. '.localhost' ).  This means the cookie domain doesn't match 
the 
modified selector.

The general suggestion I've found about getting cookies to work in this 
situation is 
to not include a domain setting.  So, defaulting the domain to '' and skipping 
it if 
not defined would be a nice solution to this problem. 

Original comment by cgmon...@gmail.com on 19 Nov 2008 at 9:53

GoogleCodeExporter commented 9 years ago
@it3xlx I had noticed some problems in this area too.  I'll definitely try to 
get a
fix in.  I won't be doing anything about extremely short lived cookies at this 
time,
however.  I allow for a number of hours to live, and I think it allows "float" 
values
which should allow for TTL less than one hour.  But a 1 second TTL is an odd 
request,
IMO.  If you have real grounds for needing something like that, please open a 
new
issue and explain your situation.

@mon...@dukece.com Thanks for your analysis.  I'll definitely use it in working 
out a
fix for this.

Thanks very much,
Jim

Original comment by auldrid...@gmail.com on 28 Jan 2009 at 8:08

GoogleCodeExporter commented 9 years ago
I've made some changes and committed in r12

Please verify these changes fix this isue without creating any others.  My 
testing
shows tings are well, but please verify.

Original comment by auldrid...@gmail.com on 12 Feb 2009 at 4:03

GoogleCodeExporter commented 9 years ago
I plugged this into my login page which checks that cookies work.  It worked 
fine in
both IE7 and FF when I set the browsers up to disable cookies.  Only problem I 
had
was re-verifying the problem... until I realized I was using a version I had 
patched
and not the "real" 2.0.

Original comment by cgmon...@gmail.com on 12 Feb 2009 at 3:46

GoogleCodeExporter commented 9 years ago
@mon...@dukece.com,
  Sorry, you lost me a bit.  Are you saying you can verify the fix with no additional
problems?  Also, remember to test the JS which is found in the source tree (
http://code.google.com/p/cookies/source/browse/ ) at /trunk/jquery.cookies.js

  The files on the download page are the latest 'release' (with all reported issues
still in it) rather than the most up to date code.

  Thanks!

Original comment by auldrid...@gmail.com on 12 Feb 2009 at 4:05

GoogleCodeExporter commented 9 years ago
Sorry, should not have just dashed a quick reply off.

R12 works correctly in my code with single name hosts in the URL.  
Specifically, my
code uses the test() method to see if session cookies are enabled.  The test 
method
uses the set, get, and del methods and should be a good test of most of your 
code.

I tested against session cookies being enabled and session cookies disabled 
using IE7
and FF3.  Both test cases worked in both browsers.

However, while I was testing, I wanted to re-verify the original issue.  I.e, 
to test
that the old code does not work for this test, but the new code works for the 
same
test.  That was my "problem" I mentioned above.  It has nothing to do with the 
new
R12 code.  I could not duplicate the original problem... until I figured out I 
was
using a version of 2.0 that I had patched to correct this issue.  

Reverting to the 2.0 Distribution code validated that it didn't work in 2.0 and 
it
does now in R12.

So, IMHO, this is good to go.  Thanks for fixing it.

Original comment by cgmon...@gmail.com on 12 Feb 2009 at 4:21

GoogleCodeExporter commented 9 years ago
@mon...@dukece.com,
  Excellent, thanks for the update and for your testing!  It is much appreciated.

Jim

Original comment by auldrid...@gmail.com on 12 Feb 2009 at 4:28