aboutsummaryrefslogtreecommitdiff
path: root/postform.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'postform.inc.php')
-rw-r--r--postform.inc.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/postform.inc.php b/postform.inc.php
index 7d7f97e..417718c 100644
--- a/postform.inc.php
+++ b/postform.inc.php
@@ -4,7 +4,8 @@
// check user credentials
if(isset($_COOKIE['microblog_login']) && $_COOKIE['microblog_login'] === sha1($config['url'].$config['admin_pass'])) {
// correct auth data, extend cookie life
- setcookie('microblog_login', sha1($config['url'].$config['admin_pass']), NOW+$config['cookie_life']);
+ $domain = ($_SERVER['HTTP_HOST'] != 'localhost') ? $_SERVER['HTTP_HOST'] : false;
+ setcookie('microblog_login', sha1($config['url'].$config['admin_pass']), NOW+$config['cookie_life'], '/', $domain, false);
} else {
// wrong data, kick user to login page
header('HTTP/1.0 401 Unauthorized');