Browse Source

DIV-1262 - Delete the SMSESSION cookie when the user logs out

pull/172/head
Michael Olund 5 years ago
parent
commit
c41ba4d0fc
2 changed files with 21 additions and 1 deletions
  1. +20
    -0
      edivorce/apps/core/static/js/main.js
  2. +1
    -1
      edivorce/apps/core/templates/base.html

+ 20
- 0
edivorce/apps/core/static/js/main.js View File

@ -899,8 +899,27 @@ var initializeChildRowControls = function(element) {
element.find('#cancel_delete_child').on('click', function() {
$('#delete_child_modal').modal('hide');
});
$('form#logoutForm').submit(function(e) {
deleteCookie("SMSESSION", "/", ".gov.bc.ca");
});
};
var deleteCookie = function(name, path, domain) {
if( getCookie(name) ) {
document.cookie = name + "=" +
((path) ? ";path="+path:"")+
((domain)?";domain="+domain:"") +
";expires=Thu, 01 Jan 1970 00:00:01 GMT";
}
}
var getCookie = function(name){
return document.cookie.split(';').some(c => {
return c.trim().startsWith(name + '=');
});
}
var populateChildInputFields = function(element) {
$('.children-questions').show();
$('.children-list').hide();
@ -1312,3 +1331,4 @@ var updateChildSupportActQuestion = function (wantChildSupport) {
}
}
};

+ 1
- 1
edivorce/apps/core/templates/base.html View File

@ -54,7 +54,7 @@
<div class="top_banner-user">
{% if request.user.is_authenticated %}
<span>
<form action="{% url 'oidc_logout' %}" method="post">
<form id="logoutForm" action="{% url 'oidc_logout' %}" method="post">
{{ request.user.display_name}}
&nbsp;&nbsp;|&nbsp;&nbsp;
{% csrf_token %}


Loading…
Cancel
Save