[pLog-svn] r990 - in plog/trunk/class/net/http: . session

Mark Wu markplace at gmail.com
Sat Feb 12 13:50:32 GMT 2005


Hi Ork:

Just report by Awia (Taiwan plogger), he told me this fix will cause his
plog 1.0 can not login. Because his web server is RaidenHTTP Web Server.

Here comes the debug $message from plog.log (reported by Aiwa):

If he use script_url, $scriptUrl = $serverVars["SCRIPT_URL"]; the debug
message in plog.log is:

12-02-2005 12:02:19 DEBUG - [sessionmanager.class.php:66 (logger:debug)]
cookie path = / 
12-02-2005 12:02:19 DEBUG - [sessionmanager.class.php:88 (logger:debug)]
cookie domain = just-blog.net 

If he use php_url, $scriptUrl = $serverVars["PHP_SELF"]; the debug message
in plog.log is:

12-02-2005 12:04:37 DEBUG - [sessionmanager.class.php:66 (logger:debug)]
cookie path = \ 
12-02-2005 12:04:37 DEBUG - [sessionmanager.class.php:88 (logger:debug)]
cookie domain = just-blog.net 

Do you think we need a if statement to deicde use script_url or php_self in
different web server (apache, iis or raidenhttp)?

Regards, Mark


-----Original Message-----
From: plog-svn-bounces at devel.plogworld.net
[mailto:plog-svn-bounces at devel.plogworld.net] On Behalf Of Benjamin Krause
Sent: Tuesday, February 08, 2005 7:10 PM
To: plog-svn at devel.plogworld.net
Subject: Re: [pLog-svn] r990 - in plog/trunk/class/net/http: . session

sorry, did not enter a commit message.. something's wrong with my vim .. :)

added a getBaseUrl() method to httpvars .. used PHP_SELF instead of
SCRIPT_URL (wich does not exist in PHP5) and added knowledge about https.
maybe we'll need that method on other locations as well ..
changed sessionmanager accordingly.

ork at devel.plogworld.net wrote:

> Author: ork
> Date: 2005-02-08 11:00:31 +0000 (Tue, 08 Feb 2005) New Revision: 990
> 
> Modified:
>    plog/trunk/class/net/http/httpvars.class.php
>    plog/trunk/class/net/http/session/sessionmanager.class.php
> Log:
> 
> 
> Modified: plog/trunk/class/net/http/httpvars.class.php
> ===================================================================
> --- plog/trunk/class/net/http/httpvars.class.php	2005-02-08 08:19:50
UTC (rev 989)
> +++ plog/trunk/class/net/http/httpvars.class.php	2005-02-08 11:00:31
UTC (rev 990)
> @@ -251,5 +251,26 @@
>  
>              return $files;
>          }
> +
> +        /**
> +         * Returns the base URL of the script
> +         *
> +         * @return A string containing the base URL of the script
> +         * @static
> +         */
> +
> +        function getBaseUrl()
> +        {
> +            $serverVars = HttpVars::getServer();
> +            if ( !isset($serverVars['HTTPS']) ||
strtolower($serverVars['HTTPS']) != 'on' ) {
> +                $protocol = 'http://';
> +            } else {
> +                $protocol = 'https://';
> +            }
> +            $host      = $serverVars["HTTP_HOST"];
> +            $scriptUrl = $serverVars["PHP_SELF"];
> +
> +            return $protocol . $host . $scriptUrl;
> +        }
>      }
>  ?>
> 
> Modified: plog/trunk/class/net/http/session/sessionmanager.class.php
> ===================================================================
> --- plog/trunk/class/net/http/session/sessionmanager.class.php
2005-02-08 08:19:50 UTC (rev 989)
> +++ plog/trunk/class/net/http/session/sessionmanager.class.php
2005-02-08 11:00:31 UTC (rev 990)
> @@ -52,8 +52,7 @@
>  			// get the right url for the script... somehow
$_SERVER["REQUEST_URI"]
>  			// is returning things like
"http://83.102.183.10.in-addr.arpa/plog/test.php"
>  			// in my case which are correct but probably not
what we're expecting!
> -			$server = HttpVars::getServer();
> -			$scriptUrl =
"http://".$server["HTTP_HOST"].$server["SCRIPT_URL"];
> +			$scriptUrl = HttpVars::getBaseUrl();
>  			$url = new Url( $scriptUrl );
>  			$path = dirname($url->getPath());
>  			if( $path == "" )
> @@ -82,4 +81,4 @@
>  			ini_set( "session.cookie_domain", $domain );
>  		}
>  	}
> -?>
> \ No newline at end of file
> +?>
> 
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.plogworld.net
> http://devel.plogworld.net/mailman/listinfo/plog-svn

_______________________________________________
pLog-svn mailing list
pLog-svn at devel.plogworld.net
http://devel.plogworld.net/mailman/listinfo/plog-svn




More information about the pLog-svn mailing list