[mapguide-users] Sessions on server side

Pietro Ianniello pietro.ianniello at gmail.com
Mon Feb 22 11:19:18 EST 2010


My point is not to use session, so I don't want to use ASP.NET sessions.
If I want to track sessions, your idea can be good, I would probably
implement something similiar fo non Anonymous users... But in this case
insead of pinging to keep session alive, I would just tell users to save
data because of session expiration. It's WEB. Sessions Expire. Users must
know it... well, this just my opinion! ...and pinging can lead to various
security risks.

The problem is with anonymous users, that is for Web Site with maps served
transparently to users by MapGuide.

             "On an infinitely fast machine, MapGuide can serve an infinite
number of users."
..ok! I knew it! I must test!!! This was just to request if someone had made
some tests and to share his/her experience....

   "You cannot reference a class directly without referencing the dll (eg
MgException).
    You can use a more generic try/catch to read the description without
knowing the type:
    try
    {
       //Bad code here
    }
    catch (Execption ex)
    {
       //Also catches MgExceptions and the like
       Console.Writeline(ex.Message);
    }"

What do you mena? I reference "MapGuideDotNetApi.dll". My problem is with
"cross AppDomain calls". Refer to "
http://winterdom.com/2007/01/makeexceptionclassesserializable" for an
explanation.

"Btw., your attachment did not make it."
What does it means? You was not able to download my attach?

Anyway, thanks for your answer.

Regards pietro ianniello

On Mon, Feb 22, 2010 at 5:03 PM, Kenneth Skovhede, GEOGRAF A/S <
ks at geograf.dk> wrote:

>  Instead of keeping sessions, and lists of sessions, how about this:
>
> Create a "start solution.aspx" that the anonymous users get a link to.
> In this file, simply log in as the anonymous user on MapGuide (or whatever
> user you want to pose as anonymous).
> Redirect to the MapGuide viewer, passing SESSION=xxx to the solution, using
> the session id you just created.
>
> You can then keep track of how many sessions there are active, using the
> .Net session events:
> http://msdn.microsoft.com/en-us/library/ms178583.aspx
>
> I recommend that you maintain a short session timeout, and "ping" an aspx
> page to keep the session alive.
>
> The number of active users depend on hardware, the dataset, the user
> behavior, etc.
> You can only determine this through testing.
> On an infinitely fast machine, MapGuide can serve an infinite number of
> users.
>
> If you want something really fancy, MapGuide has some performance counters
> you can poll.
>
> Yes, you should call dispose, and yes, it is annoying that you cannot use
> using().
> You can create a trac ticket, stating what you want changed,
> to give a better .Net experience when acessing MapGuide:
> http://trac.osgeo.org/mapguide/wiki/SubmitTicket
>
> Due to this problem (and other similar) problems, I have built the
> MaestroAPI:
> http://trac.osgeo.org/mapguide/wiki/maestro/MaestroAPI
>
> You cannot reference a class directly without referencing the dll (eg
> MgException).
> You can use a more generic try/catch to read the description without
> knowing the type:
> try
> {
>     //Bad code here
> }
> catch (Execption ex)
> {
>     //Also catches MgExceptions and the like
>     Console.Writeline(ex.Message);
> }
>
> Btw., your attachment did not make it.
>
> Regards, Kenneth Skovhede, GEOGRAF A/S
>
> On 22-02-2010 16:41, Pietro Ianniello wrote:
>
> Dear list,
>
>
>
> This question is for those who have knowledge of MagGuide internals.
>
>
>
> I want to be able to give access to some maps to anonymous users, in a way
> transparent to their session [I mean that session seems not to expire to
> such users].
>
> My idea is to maintain a list of session ID on server side, let’s say 10.
> Then on every request I pick one of my sessions, check if it’s expired, if
> it is recreate the session, and then use it to serve the map.
>
> NOTE: this only for anonymous users, obviously!
>
>
>
> I would like to know:
>
>       - What do you think of such a solution?
>
>       - How can I calculate a good number of server side maintained
> sessions?
>
>
>
> The second question can be reformulated: How many concurrent request is a
> SINGLE MapGuide server able to serve in a reasonable time…for a typical map,
> let’s say for "*Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition*",
> because it depends from the complexity of the map.
>
>
>
> Then I would like to pose some problems I have encountered using MapGide
> with ASP.NET, witch are related to how managed classes are generated
> (using SWIG, I suppose).
>
>
>
> The first is that Exceptions are not [Serializable] decorated, and don’t
> implement the “Iserializable” interface. So if someone uses MapGuide classes
> inside an assembly (as I do), she cannot catch
> OSGeo.MapGuide.ManagedException, OSGeo.MapGuide. MgException, etc….
>
>
>
> The second is releted to Dispose: all classes expose a Dispose function but
> don’t expose IDisposable interface, so we cannot use “using()”, but must
> always use try/finally, wich, when there are many variables, can bring to
> ugly code.
>
>
>  This brigs me to the following question: I always try to Dispose ALL AND
> EVERYTHING. Is it correct? In my opinion if a class exposes a Dispose
> member, I MUST CALL Dispose.
>
>
>
> A have attached an ASP.NET site with an example implementation of the
> server side maintained sessions. It’s a little bit spaghetti, because it’s a
> rewrite of a different implementation… for example in the method
> MgSheboyganCacheHelper.GetMgMapAnonymous the MgSite is not disposed… but…
> should it be or when disposing the related Mgmap it will be automatically
> disposed [this relates to the Dispose question above]?
>
>
>
> Regards,
>
>    Pietro Ianniello
>
>
> _______________________________________________
> mapguide-users mailing listmapguide-users at lists.osgeo.orghttp://lists.osgeo.org/mailman/listinfo/mapguide-users
>
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
>


-- 
Clausola di riservatezza: Le informazioni contenute in questo messaggio di
posta elettronica e gli eventuali documenti allegati sono riservate e
confidenziali ad uso esclusivo del destinatario e ne è vietata la diffusione
e la riproduzione in qualunque modo eseguita. Qualora Lei non fosse la
persona a cui il presente messaggio è destinato, La invito ad eliminarlo ed
a non leggerlo, dandone gentilmente comunicazione al mittente. I Dati sono
trattati in accordo al D.lgs n° 196 del 30.06.2003 “Codice in materia dei
dati personali”
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20100222/907f542d/attachment.html


More information about the mapguide-users mailing list