[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:

public int TestSession ()
	int x = 0;
	if (Session["x"] != null)
		x = (int)Session["x"];
		Session["x"] = x;
		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:

<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
<b>Description: </b>Error processing request.
<b>Error Message: </b>HTTP 404. File
'/monoapps/1.1/webservice/TestService.asmx/TestSession' not found.
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.:




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
MonoWapidir monoapps "/var/www/monoapps"
<Location /monoapps>
	MonoSetServerAlias monoapps
	SetHandler mono

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,

More information about the Mono-list mailing list