1。不管我设置session的超时时间为多长 ,session总是很快就超时了 这是为什么啊!!2。session在使用window.open弹出窗口时总是丢失了,但是在启动vs调试功能时,弹出窗口得session又不会丢失,这是为什么?以上两个问题 每个50分 如果确实能解决问题 分不够可以开帖另加 顶者有份!
session总是人很郁闷阿!

解决方案 »

  1.   

    session本身就不太稳定,可以用cookie
      

  2.   

    只要打开一个浏览器就会产生1个新的sessionid,也就是说有一个新session
      

  3.   

    我在使用session还好,但是最好不要在session中存大量的东西
      

  4.   

    在web.config中把 <sessionState mode="InProc" 改为<sessionState mode="StateServer"
    再把timeout改大一些
    还有要在控制面版的服务中把ASP.NET State Service启动
      

  5.   

    如果mode="InProc"那么Session是不稳定的,
    但改为mode="StateServer"后Session是很稳定的
      

  6.   

    问题不是timeout阿  这个我也会改阿
    不管我设置session的超时时间为多长 ,session总是很快就超时了
      

  7.   


    感觉Session and Cookie both 挺神秘的东西
    有时确实搞不懂
    -----------------------------------------------------
    天才是能问出好问题的人!
      

  8.   

    Session作为一个会话,很容易丢失。
    建议使用Csdn的做法,同时使用Cookie和Session,如果Session丢失了就用Cookie再生成一个Session,因为Cookie是存储在客户端的,所以相对比较稳定。
    但是要注意加密噢。
      

  9.   

    http://support.microsoft.com/default.aspx?scid=kb;EN-US;196383
      

  10.   

    把<sessionState mode="InProc" 改为<sessionState mode="StateServer">还要把服务管理器打开,找到 ASP.NET State Service,设置为自动启动,并启动该服务
      

  11.   

    1.Session丢失很可能因为服务器资源不够,这当然包括物理内存/虚拟内存不足,或者IIS上通过配置限制了你的站点对物理内存/虚拟内存的使用。很多人都说Session丢失,但是我自己的几台Windows 2003上面都没有遇到过这种情况,仅仅当我把一个站点(或者它所在的进程池)的物理内存/虚拟内存限得比较小时才会出现Session丢失。2.window.open这个怪事的责任在IE,理论上Session是不会丢失的。
      

  12.   

    虽然不知道你的为什么,但我有个办法帮你解决
    就是
    window.open('A.aspx?param1=值,param2=值,...','');再另外一个窗口用Request的属性来取值,具体是哪个记不清楚了这样就不会丢失了.也不存在Session的问题了
      

  13.   

    最好还是改为cookie跟Session结合一下!根据上面的高手说的在web.config更改参数值
      

  14.   

    在web.config中把 <sessionState mode="InProc" 改为<sessionState mode="StateServer"
    再把timeout改大一些
    还有要在控制面版的服务中把ASP.NET State Service启动以按上述设置,仍出现丢失。企盼高人!!!
      

  15.   

    我遇见过这个问题在web.config中设置:

        <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20"/>”
    设置其中的cookieless为:cookieless="true"
      

  16.   

    請教︰
    ------------------------
    如果
    把 <sessionState mode="InProc" 改为<sessionState mode="StateServer"
    把timeout改大一些
    把ASP.NET State Service启动但不限制站点的物理内存/虚拟内存及站点的连结数服务器会不挂掉了? 
      

  17.   

    Session.Abandon(); //取消当前会话
      

  18.   

    marco08(小梁) ( ) 信誉:100  2006-03-23 12:39:00  得分: 0  
     
     
       Session.Abandon(); //取消当前会话
      
     
    ------------------------------------
    SESSION丢失时间不固定,怎么使用:Session.Abandon()?
      

  19.   

    window.open的页面里,你是不是同时使用了window.close
      

  20.   

    Session跟IE进程有关,同一进程不会丢,不同的进程不会丢你看你的进程中是不是有两个ie
      

  21.   

    question:
    Disappearing Sessions
    Dear AllI'm having some trouble using session variables to store a users username and password. In theory these will be used everytime a page needs to query an oracle database.I also use the variables in response.write() lines so that I can see the variables on pages as I move around. The trouble is that the variables appear to be disappearing. At present I'm writing the aspx pages and hence I'm viewing the pages in a browser constantly refreshing pages to view my changes.When a page is loaded for the first time the query to the database is made without an issue. However when I refresh the page a couple of minutes later (session timeout is set to 30 mins) I get an erro message saying I used an invalid username/password (ORA: 01017). If I take out the query from the page and rely on looking at my variables as displayed using the response.write () statements, there are no values held.It appears that when I login the session variables are created and then read when I load another page for the first time, as soon as I refresh a page the variables appear to be destroyed. Is this right? I would expect the variables to survive after refreshing the page.
      

  22.   

    Answer 1:
    Your session variables should survive multiple trips to the site just fine (although they will time out after 30 minutes).Are you making any changes to the code between trips from the browser?  Note that anytime the application restarts your session variables will be lost -- so it could be that you are touching a web.config file, making a change in code or doing something else that causes the application to be restarted.Hope this helps,
      

  23.   

    Answer 2:
    As I read your question it was unclear if you'd created session vars.  They are specific constructs that must be establish within  your code. exampleDim critter As String
    critter = "Bird"
    Sessiong("MyCritter") = critterIn this example it would be likely that given the circumstances you describe that critter would return a null while the sessiong var MyCritter would still hold the word Bird.  Are you setting the session vars in this manner?
      

  24.   

    .net我不熟悉
    不过你们所说的和ie有关啊什么打开窗口的方法不同阿还有什么window.close相关之类的问题那基本上是不可能的哈动动脑子session在服务器端关ie什么事情哟
      

  25.   

    我的客户中 session 也经常丢,但不是.NET, 是ASP的. 请问  如果Session丢失了就用Cookie再生成一个Session 怎么操作呢?
      

  26.   

    我遇过掉失的情况,所以在写入session时同时写入数据库,如果session=null,就从数据库读入.这样改之后就没再出现掉失问题.
      

  27.   

    http://www.kbalertz.com/sresults.aspx?sw=session+lost&st=1&stec=350
      

  28.   

    弹出的窗口有没有对session进行什么操作,如果有,就有可能在你关闭这页的时候session丢失。
      

  29.   

    1/如果你的session中存了比较大数据,那么是会很容易丢失。所以最好不要放如DataSet等复杂的大的东西。2/不知道。
    建议楼主要传大数据,用viewstate(本页面),跨页面的用临时表
      

  30.   

    Session 本身就是COOKIE,只不过它与IE浏览器是同寿命的,一但关闭IE,session就在也找不回来了,OK??
      

  31.   

    我现在都用 cookies 了,里面只存储 用户ID 和 用户名。其他的现用现取。
      

  32.   

    window.showModalDialog?modal打开页面后,在打开的页面再open打开新页面时,在新开的页面总会出现Session丢失的问题,所以,在脚本中使用window.showModalDialog打开页面后慎用window.open打开页面,会导致Session取不到
    也许是ie认为新开了一个线程,可能是ie的bug