Skip to content

Commit

Permalink
gwt: Clear all cookies on logout.
Browse files Browse the repository at this point in the history
  • Loading branch information
calin-iorgulescu committed Feb 5, 2015
1 parent a79d690 commit fb330c5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public void onAuthenticationChange(AuthenticationEvent event) {
* Reset status bar when the user is logged out.
*/
eventBus.fireEvent(new StatusChangedEvent(StatusChangedEvent.StatusType.RESET, null));
CookieManager.clearCookies();
displayLogin();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class CookieManager {
public static final String COURSE_COOKIE = "VMCHK-COURSE";
public static final String USERNAME_COOKIE = "VMCHK-USER-NAME";
public static final String USERID_COOKIE = "VMCHK-USER-ID";
public static final String[] cookies = { COURSE_COOKIE, USERNAME_COOKIE, USERID_COOKIE };

/**
* the user name and id are stored as cookie because it is obtained only
Expand Down Expand Up @@ -57,5 +58,11 @@ public static void saveLastCourse(String courseId) {
public static String getLastCourse() {
return Cookies.getCookie(COURSE_COOKIE);
}

public static void clearCookies() {
for (String cookie : cookies) {
Cookies.removeCookie(cookie);
}
}

}

0 comments on commit fb330c5

Please sign in to comment.