[mapguide-users] session has expired or is invalid, please login again errors

tmblackflag steve.calpoly at gmail.com
Mon Aug 8 19:46:26 EDT 2011


Hello, I've tried searching forums but haven't had any luck with this. The
error log is giving me this:

<2011-08-08T16:43:09> 	2120			
 Error: Session has expired or is invalid. Please log in again.
 StackTrace:
  - MgSiteServiceHandler.ProcessOperation() line 83 file
d:\build\mge2012\build_42.2\ent\os\server\src\services\site\SiteServiceHandler.cpp
  - MgOpAuthenticate.Execute() line 116 file
d:\build\mge2012\build_42.2\ent\os\server\src\services\site\OpAuthenticate.cpp
  - MgServerSiteService.Authenticate() line 709 file
d:\build\mge2012\build_42.2\ent\os\server\src\services\site\ServerSiteService.cpp
  - MgSecurityManager.Authenticate() line 224 file
d:\Build\MGE2012\BUILD_42.2\Ent\OS\Server\src\Common\Manager\SecurityManager.cpp
  - MgSessionCache.GetSessionInfo() line 175 file
d:\Build\MGE2012\BUILD_42.2\Ent\OS\Server\src\Common\Manager\SessionCache.cpp	

And here is my source. I'm using a single layout and dynamically changing
the map, then copying it to the session repository and pointing my browser
frame to it. Not sure why i'm getting the invalid session errors...Logs show
me properly getting a session, finding the initial web layout resource, then
saving the new resource. 

<%@ Page language="c#" Debug="true"%>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Collections.Specialized" %>
<%@ Import Namespace="System.Text" %>
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Globalization" %>
<%@ Import Namespace="OSGeo.MapGuide" %>





<%
    try
    {
        // Initialize a session and register a variable to hold the
        // session id, then initialize the Web Extensions, connect
        // to the site, and create a session.

        InitializeWebTier();

        MgUserInformation userInfo = new MgUserInformation(defaultUser,
defaultPassword);
        MgSiteConnection siteConnection = new MgSiteConnection();        
        siteConnection.Open(userInfo);
        MgSite site = siteConnection.GetSite();
        sessionId = site.CreateSession();
        
        MgResourceService resourceService =
siteConnection.CreateService(MgServiceType.ResourceService) as
MgResourceService;        
        
        string propFloor = "RUSHMMAF01";

        MgResourceIdentifier wlResourceId = new
MgResourceIdentifier(webLayout);            
        MgByteReader reader =
resourceService.GetResourceContent(wlResourceId);

        XmlDocument doc = new XmlDocument();
        doc.PreserveWhitespace = true;
        String xmlLayoutDef = reader.ToString();
        doc.LoadXml(xmlLayoutDef);

        //webLayoutXML.GetElementsByTagName("ResourceId").Item(0).InnerText
= "Library://MILP/Maps/" + propfloor + ".MapDefinition";

        MgResourceIdentifier newLayout = new MgResourceIdentifier("Session:"
+ sessionId + "//basic.WebLayout");
        resourceService.SetResource(newLayout, new
MgByteReader(doc.OuterXml, "text/xml"), null);
                               
    }
     catch (Exception e)
    {
        Response.Write(e.Message);
    }

%>

<html>
<head>
	<title>Viewer Sample Application</title>
</head>
<frameset rows="40,*" frameborder="no" framespacing="0">
	&lt;frame id=&quot;layerFrame&quot; name=&quot;layerFrame&quot;
frameborder=&quot;no&quot; marginwidth=&quot;0&quot;
marginheight=&quot;0&quot; scrolling=&quot;no&quot;
src=&quot;layerrefresh.aspx?SESSION=&lt;%=sessionId%&gt;">
	&lt;frame id=&quot;viewerFrame&quot; name=&quot;viewerFrame&quot;
frameborder=&quot;no&quot; marginwidth=&quot;0&quot;
marginheight=&quot;0&quot; scrolling=&quot;yes&quot;
src=&quot;../mapviewernet/ajaxviewer.aspx?SESSION=&lt;%=sessionId%&gt;&WEBLAYOUT=Session:<%=sessionId%>//basic.WebLayout">
</frameset>
</html>

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/session-has-expired-or-is-invalid-please-login-again-errors-tp6666325p6666325.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list