diff options
Diffstat (limited to 'sca-cpp/trunk/modules')
-rwxr-xr-x | sca-cpp/trunk/modules/http/open-auth-conf | 2 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/http/openauth.hpp | 4 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/oauth/mod-oauth1.cpp | 2 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/oauth/mod-oauth2.cpp | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/sca-cpp/trunk/modules/http/open-auth-conf b/sca-cpp/trunk/modules/http/open-auth-conf index 46fc5f88df..1c4d18b1e9 100755 --- a/sca-cpp/trunk/modules/http/open-auth-conf +++ b/sca-cpp/trunk/modules/http/open-auth-conf @@ -35,7 +35,7 @@ cat >>$root/conf/auth.conf <<EOF AuthType Open AuthName "$host" Session On -SessionCookieName TuscanyOpenAuth path=/;secure=TRUE +SessionCookieName TuscanyOpenAuth domain=.$host;path=/;secure=TRUE SessionCryptoPassphrase $pw AuthOpenAuth On AuthOpenAuthLoginPage /login diff --git a/sca-cpp/trunk/modules/http/openauth.hpp b/sca-cpp/trunk/modules/http/openauth.hpp index 9023848305..9b49cfa4c2 100644 --- a/sca-cpp/trunk/modules/http/openauth.hpp +++ b/sca-cpp/trunk/modules/http/openauth.hpp @@ -73,11 +73,11 @@ const maybe<string> sessionID(const request_rec* r) { /** * Convert a session id to a cookie string. */ -const string cookie(const string& sid) { +const string cookie(const string& sid, const string& domain) { const time_t t = time(NULL) + 86400; char exp[32]; strftime(exp, 32, "%a, %d-%b-%Y %H:%M:%S GMT", gmtime(&t)); - const string c = string("TuscanyOpenAuth=") + sid + string(";path=/;expires=" + string(exp)) + ";secure=TRUE"; + const string c = string("TuscanyOpenAuth=") + sid + ";domain=." + domain + ";path=/;expires=" + string(exp) + ";secure=TRUE"; debug(c, "openauth::cookie"); return c; } diff --git a/sca-cpp/trunk/modules/oauth/mod-oauth1.cpp b/sca-cpp/trunk/modules/oauth/mod-oauth1.cpp index acf39601b3..2b43ecc953 100644 --- a/sca-cpp/trunk/modules/oauth/mod-oauth1.cpp +++ b/sca-cpp/trunk/modules/oauth/mod-oauth1.cpp @@ -378,7 +378,7 @@ const failable<int> access_token(const list<list<value> >& args, request_rec* r, return mkfailure<int>(reason(prc)); // Send session ID to the client in a cookie - apr_table_set(r->err_headers_out, "Set-Cookie", c_str(openauth::cookie(sid))); + apr_table_set(r->err_headers_out, "Set-Cookie", c_str(openauth::cookie(sid, httpd::hostName(sc.server)))); return httpd::externalRedirect(httpd::url(r->uri, r), r); } diff --git a/sca-cpp/trunk/modules/oauth/mod-oauth2.cpp b/sca-cpp/trunk/modules/oauth/mod-oauth2.cpp index a662333c9e..639d927891 100644 --- a/sca-cpp/trunk/modules/oauth/mod-oauth2.cpp +++ b/sca-cpp/trunk/modules/oauth/mod-oauth2.cpp @@ -230,7 +230,7 @@ const failable<int> access_token(const list<list<value> >& args, request_rec* r, return mkfailure<int>(reason(prc)); // Send session ID to the client in a cookie - apr_table_set(r->err_headers_out, "Set-Cookie", c_str(openauth::cookie(sid))); + apr_table_set(r->err_headers_out, "Set-Cookie", c_str(openauth::cookie(sid, httpd::hostName(sc.server)))); return httpd::externalRedirect(httpd::url(r->uri, r), r); } |