zoukankan      html  css  js  c++  java
  • mvc Session为什么丢失?

    环境:mvc 1.0
    问题:在系统启动时会产生一个Session. Session["admin_ID"] = "aa27ec10-d9d4-43d9-96f6-7cfb0d5099ca";
    但是在执行了下面代码后,Session就会丢失。

    C# code
    [AcceptVerbs(HttpVerbs.Post)] public ActionResult GenerateVerifyModel(FormCollection formCollection) { ... return File(zipPath, "application/x-zip-compressed"); }



    百思不得其解,为什么下载文件后就会丢失session?

    后来在Web.config中进行了如何设置:
        <sessionState mode="StateServer" cookieless="false" timeout="60" stateConnectionString="tcpip=127.0.0.1:42424"
                    stateNetworkTimeout="3600" />

    但是运行时提示:
    Unable    to    serialize    the    session    state.    Please    note    that    non-serializable    objects    or    MarshalByRef    objects    are    not    permitted    when    session    state    mode    is    'StateServer'    or    'SQLServer'.   
    看这个提示应该是说Session中的内容无法序列化,可是Session中只有一个GUID啊。Session["admin_ID"] = "aa27ec10-d9d4-43d9-96f6-7cfb0d5099ca";

    请高手指点。

  • 相关阅读:
    Zookeeper安装-单机版
    Centos 7 安装 Redis 5
    java利用dom4j将xml字符串转换为json
    计算机科学导论笔记-计算机组成
    计算机科学导论笔记-数据运算
    计算机科学导论笔记-数据存储
    计算机科学导论笔记-数字系统
    计算机科学导论笔记
    springmvc03
    springmvc02
  • 原文地址:https://www.cnblogs.com/hearticy/p/1606851.html
Copyright © 2011-2022 走看看