Closed Bug 302865 Opened 19 years ago Closed 18 years ago

In cookies exceptions list, should also have option for session cookies only, not just allow/deny

Categories

(Camino Graveyard :: Preferences, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
Camino1.5

People

(Reporter: nguyenhm16, Assigned: bugzilla-graveyard)

References

Details

(Keywords: fixed1.8.1, Whiteboard: [add localizable.strings from comments 31, 34, 35])

Attachments

(2 files, 9 obsolete files)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b4) Gecko/20050730 Camino/0.9a2+
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b4) Gecko/20050730 Camino/0.9a2+

I have some sites set to allow session cookies only in my hostperm.1 file (e.g.
"host cookie 8 ...") and Camino will respect that, but there's no way to set
that from the GUI. It seems like a small change to add a third option, "Session
cookies only"

Reproducible: Always

Steps to Reproduce:

Actual Results:  
You can only select allow/deny in Preferences->Privacy->Edit Exceptions List...;
sites that have an "host cookie 8..." in hostperm.1 show up as deny, even though
Camino behaves correctly.

Expected Results:  
Should have an option for "Session cookies only" also, not just "Allow" and "Deny"
Bug 174070 is for a global setting that you can set in user.js; this bug is for
per-site settings in hostperm.1.
Target Milestone: --- → Camino1.2
Since Pinkerton gave it a target, confirming ;)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Here's a proposal:

Retitle the "Allow/Deny" column to "Policy" and add a third option, titled "Session only".

Thoughts?

cl
Sounds reasonable enough to me.
Taking. I'm about 90% done with this one already. The only issue I have left is how to ensure that the "Policy" column can be re-sized, and give it a slightly larger default width (so the phrase "Session Only" shows up in its entirety).

cl
Assignee: mikepinkerton → bugzilla
Target Milestone: Camino1.2 → Camino1.1
Status: NEW → ASSIGNED
Attached patch The patch so far (obsolete) — Splinter Review
Here's what I've got so far. It's fully functional, but has the visual anomalies I mentioned above. If anyone has any ideas on that, I'm open to suggestions.

cl
Fixes the visual problems mentioned earlier, too. This is ready for some review lovin'.

cl
Attachment #202766 - Flags: review?(mikepinkerton)
Comment on attachment 202760 [details] [diff] [review]
The patch so far

Asking for r=pink.
Attachment #202760 - Flags: review?(mikepinkerton)
Attached file the real nib shady (obsolete) —
The *real* NIB file with the fixes.

cl
Attachment #202766 - Attachment is obsolete: true
Attachment #202767 - Flags: review?(mikepinkerton)
Attachment #202766 - Flags: review?(mikepinkerton)
Attachment #202767 - Attachment is patch: false
Attachment #202767 - Attachment mime type: text/plain → application/zip
Comment on attachment 202767 [details]
the real nib shady

This nib is obsolete now that the one from bug 314557 has landed....
Attachment #202767 - Attachment is obsolete: true
Attachment #202767 - Flags: review?(mikepinkerton)
(In reply to comment #11)
> (From update of attachment 202767 [details] [edit])
> This nib is obsolete now that the one from bug 314557 has landed....

Right-o. I'll post a new one later tonight, hopefully.

cl
Attached file updated for latest nib changes (obsolete) —
This should be ready to go now, barring any other changes to the nib or PrivacyPane.mm.

cl
CCing Simon, retargeting for 1.0 since we now have a working patch.

cl
Target Milestone: Camino1.1 → Camino1.0
Comment on attachment 203176 [details]
updated for latest nib changes

Obsolete due to check-in of bug 269084.
Attachment #203176 - Attachment is obsolete: true
Comment on attachment 202760 [details] [diff] [review]
The patch so far

Obsolete due to check-in of bug 269084.
Attachment #202760 - Attachment is obsolete: true
Attachment #202760 - Flags: review?(mikepinkerton)
Target Milestone: Camino1.0 → ---
Chris, are you working on an updated patch?
Woops, forgot to post the new one. Will get that up tonight.

cl
Updated source code.
Attachment #204622 - Flags: review?
Attached file Updated nib file, zipped up. (obsolete) —
The nib file.
Attachment #204623 - Flags: review?
So if we allow the user to specify session-only in the Exceptions List, why don't we:
a) for all cookies (which is what many users want), and
b) for each cookie in the "this page wants to set a cookie" sheet?
(In reply to comment #21)
> So if we allow the user to specify session-only in the Exceptions List, why
> don't we:
> a) for all cookies (which is what many users want), and

Bug 174070 (which is assigned to Simon, hah!)

> b) for each cookie in the "this page wants to set a cookie" sheet?

Bug 173521, which was WONTFIXed, although I think there's quite a bit of support for it (despite Mike's decision).

cl
We should do all or none.
(In reply to comment #23)
> We should do all or none.

I agree, and my vote would be for "all".

cl
Depends on: 174070
Blocks: 174070
No longer depends on: 174070
Target Milestone: --- → Camino1.1
No longer blocks: 174070
This matches the wording used in the request sheet (as updated by bug 323842), using "Allow for Session" rather than "Session Only" (which smorgan pointed out was a bad idea).
Attachment #204622 - Attachment is obsolete: true
Attachment #208827 - Flags: review?
Attachment #204622 - Flags: review?
Attached file updated nib file
Changes "Allow/Deny" column title to "Policy", adds a bit of width so "Allow for Session" isn't truncated.

cl
Attachment #204623 - Attachment is obsolete: true
Attachment #208828 - Flags: review?
Attachment #204623 - Flags: review?
(In reply to comment #23)
> We should do all or none.
 
Because of Core bug 249596, which was just WONTFIXed, we cannot do exactly what was requested in bug 174070 without a lot of convoluted logic and a great deal of user confusion, so my vote has just changed to "all but that".

cl
Accidentally posted this in the other session cookie bug. Oops.

cl
Attachment #208827 - Attachment is obsolete: true
Attachment #209319 - Flags: review?(stuart.morgan)
Attachment #208827 - Flags: review?
Attachment #208828 - Flags: review? → review?(stuart.morgan)
Comment on attachment 209319 [details] [diff] [review]
fixed per stuart's comments, also fixes broken search on policy column

Looks good--and yes pink, I even tested aol.com ;)

r=me
Attachment #209319 - Flags: superreview?
Attachment #209319 - Flags: review?(stuart.morgan)
Attachment #209319 - Flags: review+
Comment on attachment 208828 [details]
updated nib file

Nib looks fine (although marking things as patches makes them text/plain, so don't do that).
Attachment #208828 - Attachment is patch: false
Attachment #208828 - Attachment mime type: text/plain → application/octet-stream
Attachment #208828 - Flags: review?(stuart.morgan) → review+
Oh, and whoever checks this in needs to remember to add an entry in the Privacy pane's Localizable.strings file for "Allow for Session"
Comment on attachment 209319 [details] [diff] [review]
fixed per stuart's comments, also fixes broken search on policy column

>Index: PrivacyPane.mm
>===================================================================

> // popup indices
> const int kAllowIndex = 0;
>-const int kDenyIndex = 1;
>+const int kSessionOnlyIndex = 1;
>+const int kDenyIndex = 2;

Use an enum (implicit ordering)?

>+// nsIPermissonManager, for some reason, doesn't have a constant for Allow for Session
>+const int kAllowForSessionAction = 8;

You should use nsICookiePermission::ACCESS_SESSION rather than this.


> // callbacks for sorting the permission list
>+PR_STATIC_CALLBACK(int) indexForCapability(int aCapability)
>+{
>+  if (aCapability == nsIPermissionManager::DENY_ACTION)
>+    return kDenyIndex;
>+  if (aCapability == kAllowForSessionAction)
>+    return kSessionOnlyIndex;
>+  else
>+    return kAllowIndex;

Use a switch() statement.


>+  // set up policy popups
>   NSPopUpButtonCell *popupButtonCell = [mPermissionColumn dataCell];
>   [popupButtonCell setEditable:YES];
>-  [popupButtonCell addItemsWithTitles:[NSArray arrayWithObjects:[self getLocalizedString:@"Allow"], [self getLocalizedString:@"Deny"], nil]];
>+  [popupButtonCell addItemsWithTitles:[NSArray arrayWithObjects:[self getLocalizedString:@"Allow"], [self getLocalizedString:@"Allow for Session"], [self getLocalizedString:@"Deny"], nil]];

Wrap these lines like:

    [popupButtonCell addItemsWithTitles:[NSArray arrayWithObjects:[self getLocalizedString:@"Allow"],
                                                                  [self getLocalizedString:@"Allow for Session"],
                                                                  [self getLocalizedString:@"Deny"],
                                                                  nil]];

sr=me with those changes.
Attachment #209319 - Flags: superreview? → superreview+
Attached patch Applies Simon's suggestions (obsolete) — Splinter Review
Suggestions fixed, along with two more fixes pointed out on IRC.

Pink said this could go in on trunk whenever someone gets around to it, along with the related bug 323842.

cl
Attachment #209319 - Attachment is obsolete: true
When the checker-in-er person adds the new Localizable.string for this bug (comment 31), can he also change the string in bug 328802, please.
Blocks: 328802
Also please get the string change for bug 329011 with these other strings changes.
Blocks: 329011
Comment on attachment 209425 [details] [diff] [review]
Applies Simon's suggestions

>Index: PrivacyPane.h
>===================================================================

>+// network.cookie.cookieBehavior settings
>+// these are the defaults, overriden by whitelist/blacklist
>+typedef enum ECookieBehaviorSettings
>+{
>+  eAcceptAllCookies,
>+  eAcceptCookiesFromOriginatingServer,
>+  eDenyAllCookies
>+};
>+
>+// for the "Policy" column in the Exceptions List
>+typedef enum ECookiePolicyPopupIndex
>+{
>+  eAllowIndex,
>+  eSessionOnlyIndex,
>+  eDenyIndex
>+};

You are not actually defining new types here; you probably want

typedef enum Foo {
...
} Foo;


>Index: PrivacyPane.mm
>===================================================================

> // callbacks for sorting the permission list
>+PR_STATIC_CALLBACK(int) indexForCapability(int aCapability)
>+{
>+  switch (aCapability)
>+  {
>+    case nsIPermissionManager::DENY_ACTION:
>+      return eDenyIndex;
>+	case nsICookiePermission::ACCESS_SESSION:
>+      return eSessionOnlyIndex;
>+    default: // match nsIPermissionManager::ALLOW_ACTION and other values
>+      return eAllowIndex;
>+  }

You could make this self-documenting:

    switch (aCapability)
    {
        case nsIPermissionManager::DENY_ACTION:
            return eDenyIndex;

        case nsICookiePermission::ACCESS_SESSION:
            return eSessionOnlyIndex;

        case nsIPermissionManager::ALLOW_ACTION:
        default:
            return eAllowIndex;
    }

We'd better be sure that the values of the enums in nsIPermissionManager and
nsICookiePermission don't conflict!
Transferred flags. This should be ready for checkin now.

cl
Attachment #209425 - Attachment is obsolete: true
Attachment #213767 - Flags: superreview+
Attachment #213767 - Flags: review+
Blocks: 174070
Whiteboard: [add localizable.strings from comments 31, 34, 35]
Strings change is in on the trunk and 1.8 branch.
Keywords: fixed1.8.1
Checked in, trunk and 1.8.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Patch needs detabbing :(
Verified on 1.8 branch and trunk
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: