Closed
Bug 193078
Opened 23 years ago
Closed 23 years ago
Cookie entries are wiped out by creating a new profile
Categories
(Core :: Networking: Cookies, defect)
Core
Networking: Cookies
Tracking
()
RESOLVED
FIXED
mozilla1.3final
People
(Reporter: kazhik, Assigned: ccarlen)
References
Details
(Keywords: dataloss)
Attachments
(1 file, 1 obsolete file)
|
4.26 KB,
patch
|
mvl
:
review+
darin.moz
:
superreview+
asa
:
approval1.3+
|
Details | Diff | Splinter Review |
Cookie entries are wiped out by creating a new profile.
Steps to reproduce:
(1) Select [Tools]-[Switch Profile] and create a new profile.
(2) Launch with the new profile and quit.
(3) Launch with the old profile and open Cookie Manager dialog.
Build: 2003021108-trunk/Win98
Comment 1•23 years ago
|
||
sounds like we might be missing some profile change notifications in the cookies
code :(
Comment 2•23 years ago
|
||
This should be easy to fix. Its just to do as IE does it, one cookie map for
each profile...
Comment 3•23 years ago
|
||
Confirmed by mvl on a recent build.
relevant code is:
http://lxr.mozilla.org/seamonkey/source/extensions/cookie/nsCookieService.cpp#210
No idea what's going on here, probably some subtle bug...
Comment 4•23 years ago
|
||
Using a few printf's, I found out that at
http://lxr.mozilla.org/seamonkey/source/extensions/cookie/nsCookieService.cpp#218
when changing back to the old profile, mDir still contains the path of the
original profile. So that cookie file is updated. The cookies that were there,
are now gone.
So that caching of mDir is the problem.
| Assignee | ||
Comment 5•23 years ago
|
||
> So that caching of mDir is the problem.
You're right. Caching mDir was put in for bug 158216, so it got broken then. If
mDir is being cached, it simply needs to be reset after the profile changes.
| Assignee | ||
Comment 6•23 years ago
|
||
I'll take it. I have a patch that I'll be able to test when the rest of my build
finishes.
Assignee: darin → ccarlen
OS: Windows 98 → All
Hardware: PC → All
Target Milestone: --- → mozilla1.3final
| Assignee | ||
Comment 7•23 years ago
|
||
mDir shouldn't be cached anyway. It's used infrequently, once per profile
session and, even if it was used frequently, directory service caches
internally anyway.
| Assignee | ||
Updated•23 years ago
|
Attachment #114343 -
Flags: superreview?(darin)
Attachment #114343 -
Flags: review?(mvl)
Comment 8•23 years ago
|
||
Comment on attachment 114343 [details] [diff] [review]
patch
>- COOKIE_Write(mDir);
>+ nsCOMPtr<nsIFile> profileDir;
>+ rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(profileDir));
>+ if (NS_SUCCEEDED(rv))
>+ COOKIE_Write(profileDir);
> COOKIE_RemoveAll();
Why not use COOKIE_Write(nsnull) and let COOKIE_Write find the profile? It is
doing that anyway.
And when you do that, you can as well remove the parameter from the prototype
of COOKIE_Write, as all the callers use nsnull as parameter.
| Assignee | ||
Comment 9•23 years ago
|
||
Attachment #114343 -
Attachment is obsolete: true
| Assignee | ||
Updated•23 years ago
|
Attachment #114343 -
Flags: superreview?(darin)
Attachment #114343 -
Flags: review?(mvl)
| Assignee | ||
Updated•23 years ago
|
Attachment #114350 -
Flags: review?(mvl)
Comment 10•23 years ago
|
||
Comment on attachment 114350 [details] [diff] [review]
removes dir param from COOKIE_Write()
Patch looks good to me.
Attachment #114350 -
Flags: review?(mvl) → review+
| Assignee | ||
Updated•23 years ago
|
Attachment #114350 -
Flags: superreview?(darin)
Comment 11•23 years ago
|
||
Comment on attachment 114350 [details] [diff] [review]
removes dir param from COOKIE_Write()
sr=darin (thanks conrad!)
Attachment #114350 -
Flags: superreview?(darin) → superreview+
Comment 12•23 years ago
|
||
Comment on attachment 114350 [details] [diff] [review]
removes dir param from COOKIE_Write()
Requesting approval.
This is a dataloss bug when switching profiles. The risk of the patch are
pretty small (just removing the caching of an item)
Attachment #114350 -
Flags: approval1.3?
Comment 13•23 years ago
|
||
Comment on attachment 114350 [details] [diff] [review]
removes dir param from COOKIE_Write()
a=asa (on behalf of drivers) for checkin to 1.3 final
Attachment #114350 -
Flags: approval1.3? → approval1.3+
| Assignee | ||
Comment 14•23 years ago
|
||
Fixed. Thanks Michiel - you handed the fix to me on a platter :-)
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 15•23 years ago
|
||
*** Bug 193531 has been marked as a duplicate of this bug. ***
You need to log in
before you can comment on or make changes to this bug.
Description
•