Skip to content
Snippets Groups Projects
Commit 58a04ce1 authored by Satsuki Yanagi's avatar Satsuki Yanagi Committed by syuilo
Browse files

ログアウトの処理と外部サービス連携Viewがセッションクッキーを作らないように (#4856)

parent c6249b82
No related branches found
No related tags found
No related merge requests found
......@@ -54,7 +54,11 @@ export default Vue.extend({
},
mounted() {
document.cookie = `i=${this.$store.state.i.token}`;
if (!document.cookie.match(/i=(\w+)/)) {
document.cookie = `i=${this.$store.state.i.token}; path=/;` +
` domain=${document.location.hostname}; max-age=31536000;` +
(document.location.protocol.startsWith('https') ? ' secure' : '');
}
this.$watch('$store.state.i', () => {
if (this.$store.state.i.twitter) {
if (this.twitterForm) this.twitterForm.close();
......
......@@ -126,7 +126,7 @@ export default (os: MiOS) => new Vuex.Store({
logout(ctx) {
ctx.commit('updateI', null);
document.cookie = 'i=;';
document.cookie = `i=; max-age=0; domain=${document.location.hostname}`;
localStorage.removeItem('i');
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment