[Mono-list] Session problem with mod_mono

Mike Leahy mgleahy at alumni.uwaterloo.ca
Tue Jul 3 00:48:47 EDT 2007


Hello list,

I have what I hope is an easy-to-solve problem.  I'm just getting
started using mod_mono.  I'm trying to see if I can get a WebService
running with cookieless sessions.  I added a method to TestService.asmx
from the xsp test samples, that looks as follows:

[WebMethod(EnableSession=true)]
public int TestSession ()
{
	int x = 0;
	if (Session["x"] != null)
	{
		x = (int)Session["x"];
		x++;
		Session["x"] = x;
	}
	else
	{
		Session["x"] = 0;
	}
	return x;
}

If I add <sessionState mode="InProc" cookieless="false"/> to the
system.web section of the web.config file, it works fine, but once I set
cookieless="true", it fails as follows:

<html>
<title>Error 404</title><body bgcolor="white"><h1><font
color="red">Server error in '/monoapps' application</font></h1><hr>
<h2><font color="maroon"><i>File
'/monoapps/1.1/webservice/TestService.asmx/TestSession' not
found.</i></font></h2>
<b>Description: </b>Error processing request.
<p>
<b>Error Message: </b>HTTP 404. File
'/monoapps/1.1/webservice/TestService.asmx/TestSession' not found.
<p>
<hr>
</body>
</html>
<!--
System.Web.HttpException: File
'/monoapps/1.1/webservice/TestService.asmx/TestSession' not found.
  at System.Web.StaticFileHandler.ProcessRequest (System.Web.HttpContext
context) [0x00000]
  at System.Web.HttpApplication+&lt;Pipeline&gt;__1.MoveNext () [0x00000]
-->

Now, I know the session id is supposed to be in the URL, and it is there
 in the browser, e.g.:

http://localhost/monoapps/(DB271823EA2F4B06CA2461CF)/1.1/webservice/TestService.asmx?page=op&tab=test&op=TestSession&bnd=TestServiceSoap&ext=testform

or:

http://localhost/monoapps/(DB271823EA2F4B06CA2461CF)/1.1/webservice/TestService.asmx/TestSession

If it is of any use, here is the Apache conf file for my monoapps folder
(which is really just a copy of the xsp test folder):

Alias /monoapps "/var/www/monoapps"
AddMonoApplications monoapps "/monoapps:/var/www/monoapps"
MonoServerPath monoapps /usr/bin/mod-mono-server
MonoPath monoapps
"/var/www/monoapps:/var/www/monoapps/bin:/var/www/monoapps/1.1:/var/www/monoapps/2.0"
MonoWapidir monoapps "/var/www/monoapps"
<Location /monoapps>
	MonoSetServerAlias monoapps
	SetHandler mono
</Location>

I came across various discussions about a bug that seemed related to
this kind of problem, but I imagine that it's more likely that I'm just
missing something in my setup.  I've encountered this exact same problem
with mono-1.1.17 on fc6, and mono-1.2.3 on fc7 (64-bit).  Can anyone
make any suggestions?

If there is a better list for this sort of question, or maybe some
documentation that clarifies how I should be configuring this, I
wouldn't mind being pointed in the right direction.

Thanks in advance,
Mike


More information about the Mono-list mailing list