From 43299e7174718045d3804f0c3a3fd69a6fc16230 Mon Sep 17 00:00:00 2001 From: Ugnich Anton Date: Sun, 31 Mar 2013 09:51:16 +0700 Subject: Login cookies only for main domain --- src/java/com/juick/http/www/Login.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/java/com/juick/http/www/Login.java b/src/java/com/juick/http/www/Login.java index 79f626d0..3a715870 100644 --- a/src/java/com/juick/http/www/Login.java +++ b/src/java/com/juick/http/www/Login.java @@ -81,7 +81,6 @@ public class Login { if (com.juick.server.UserQueries.getUIDbyHash(sql, hash) > 0) { Cookie c = new Cookie("hash", hash); - c.setDomain(".juick.com"); c.setMaxAge(365 * 24 * 60 * 60); response.addCookie(c); @@ -103,7 +102,6 @@ public class Login { if (uid > 0) { String hash = com.juick.server.UserQueries.getHashByUID(sql, uid); Cookie c = new Cookie("hash", hash); - c.setDomain(".juick.com"); c.setMaxAge(365 * 24 * 60 * 60); response.addCookie(c); @@ -138,6 +136,10 @@ public class Login { c.setMaxAge(0); response.addCookie(c); + Cookie c2 = new Cookie("hash", "-"); + c2.setMaxAge(0); + response.addCookie(c2); + response.sendRedirect("/"); } } -- cgit v1.2.3