&quot;Ok, I can see that I misjudged your experience level completely&quot;<br>No problem :-), I see that there are many questions about things such as &quot;Can I use images in MapGuide&quot; and such, wich are all answered in MapGuide developer guide [wich should be printed and read ,and re-read... and re-re-read!].<br>

<br>If you are intersted, you can download the attachment from <br><a href="http://n2.nabble.com/Sessions-on-server-side-td4612873.html">http://n2.nabble.com/Sessions-on-server-side-td4612873.html</a><br><br>It assumes MapGuide OS installed in &quot;C:\OSGeo&quot;<br>

so &quot;webconfig.ini&quot; in &quot;<b>C:\OSGeo\MapGuide\Web\www</b>&quot;,<br>with the .NET viewer.<br><br>If it is in another place, the file &quot;<b>MgSheboyganCacheHelper.cs</b>&quot; at line 61 bust be accordingly changed.<br>

<br>A better approach is to use the following function (as I do in my assembly that controls MapGuide):<br><br><span style="font-family: courier new,monospace;">   //call CLASSNAME.SetIniPath(&quot;/mapguide/&quot;);</span><br>

        <span style="font-family: courier new,monospace;">public static void SetIniPath(string strMGVirtualDirectoryPath)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">   {</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">            string physicalpath = <br>                     HttpContext.Current.Server.MapPath(strMGVirtualDirectoryPath);</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">            _strWebconfigPhysicalInipath = physicalpath + &quot;webconfig.ini&quot;;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">            _strIniBasePhysicalPath = physicalpath;</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">            _strWebconfigWebInipath = strMGVirtualDirectoryPath + &quot;webconfig.ini&quot;;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">            _strIniBaseWebPath = strMGVirtualDirectoryPath;</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">   }</span><br><br>wich assumes the following members [default initialized]:<br><br><font size="1"><span style="font-family: courier new,monospace;">protected static string _strWebconfigPhysicalInipath = 
&quot;C:\\OSGeo\\MapGuide\\Web\\www\\webconfig.ini&quot;;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">protected static string _strIniBasePhysicalPath = &quot;C:\\OSGeo\\MapGuide\\Web\\www\\&quot;;</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">protected static string _strWebconfigWebInipath = &quot;<a href="http://localhost/mapguide/webconfig.ini">http://localhost/mapguide/webconfig.ini</a>&quot;;</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">protected static string _strIniBaseWebPath = &quot;<a href="http://localhost/mapguide/">http://localhost/mapguide/</a>&quot;;</span></font>
<br><br>My solution works, and I like it.<br>I only have concerns about scalability: what will MapGuide do when there are multiple requests with the same session? Will it queue them properly as if sessons where al different? <br>

<br>A further explanation on why I use such a thing.<br><br>I use MapGuide with Openlayers. OpenLayers can request &quot;showLayers&quot;,&quot;hideLayers&quot;. I set up maps with all layers default invisible. The I &quot;activate&quot; the layers I want to see in javascript using the two OpenLayers option just mentioned. This could be done on server side, but in this case the state of the map would be stored in session [<i style="font-family: courier new,monospace;">layer.SetVisible(true);map.Save();</i>], and, furthermore, my idea is that if something can be done on the client, do it on the client and save computation on the server.<br>

<br>The proble with &quot;showLayers/hideLayers&quot; is that they need &quot;ObjectId&quot; of the layer. So to give that id you must do something like:<br><i>_map.GetLayers().GetItem(&quot;&lt;LAYER NAME&gt;&quot;).GetObjectId();</i><br>

and this must be done on every session expiration.<br>So when in my solution [the real, not the posted one] I recreate the server side mantained &quot;cache&quot; of session, I recreate a list with these ObjectId.<br><br>

If my solution doesn&#39;t scale well, the alternative is to recreate OpenLayers&#39; layers with a new session and store in javascript the new ObjectIds. This is a lot of work for many reasons it&#39;s off topic to expose. <br>

<br>I prefer my solution even because shelds me from exposing sessions, and with &quot;MgSheboyganCacheHelper.cs&quot; I could one day [time permitting] expose MapGuide only to localhost, using a proxy to access it - something like &quot;MgSheboyganCacheHelper.cs&quot; but more general.<br>

<br>This for Anonymous users, and for publicly available sites.<br><br>If one wants to use MapGuide in intranet or to do editing, it&#39;s a different story.<br><br>Regard,<br>    Pietro Ianniello<br><br>P.S.: I could answer to my question by downloading MapGuide sources... even though I am programming in C#, I come from C++, so it would not be a problem, but I think it would requre HUGE ammount of time! And now I don&#39;t have it...<br>

<br>P.P.S.: [out of topic] It would be nice if somwhere there is some info about updating FDO with the current MG OS. For example usng FDO 3.4.1 instead of 3.4.0... I say this in perspective... I am very intersted in PostGIS, and anxious to see and test a good implementation, because now it&#39;s not usable [seems FDO 4.5 will, If I understand  - <a href="http://trac.osgeo.org/fdo/wiki/FDORfc45">http://trac.osgeo.org/fdo/wiki/FDORfc45</a> - if that 45 stands for 4.5].<br>

<br><div class="gmail_quote">P.P.P.S.: I anwered 2 times before, because <span class="gI"><span class="gD" style="color: rgb(91, 16, 148);">Mail Delivery System</span> <span class="go">&lt;<a href="mailto:MAILER-DAEMON@lists.osgeo.org">MAILER-DAEMON@lists.osgeo.org</a>&gt; continues to tell me that:</span></span><br>

<span style="font-family: courier new,monospace;">             I&#39;m sorry to have to inform you that your message could not</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">             be delivered to one or more recipients. It&#39;s attached below.</span><br style="font-family: courier new,monospace;">

Don&#39;t know why...<br>
</div><br>