//代码
<%
if Session("user")="" then
Response.Write"<script language=javascript>alert(""你还没有登陆!或登陆超时!"");</script>"
response.write "<script language=javascript>parent.location.href='../index.asp';</script>"
response.End()
end if
%> asp的      怎么解决 IE和别的 浏览器的兼容!

解决方案 »

  1.   

    vb不懂,不过session()这是个方法吗?
      

  2.   

    我记得session是要【"某某对象或变量"】这么写
      

  3.   

    这应该是vb.net
    啥叫不兼容?而且应该这么判断
    if Session("user")=Nothing then
    ...Session默认20分钟过期。
      

  4.   

    Session默认20分钟过期。
    指的是20分钟没有request进来。
      

  5.   

    擦session 还存在兼容问题要么是过期了
      

  6.   

    现在的服务器少用Session
    Session根本就不存在不兼容这一说
      

  7.   

    ++
    Forms验证  
    <configuration>  
    <system.web>  
    <authentication mode="Forms">  
    <forms name="MYWEBAPP.ASPXAUTH" loginUrl="login.aspx"  
    protection="All" path="/"/>  
    </authentication>  
    <authorization>  
    <allow users="*"/>  
    </authorization>  
    </system.web>  
    <location path="admin">  
    <system.web>  
    <authorization>  
    <allow roles="Administrator"/>  
    <deny users="*"/>  
    </authorization>  
    </system.web>  
    </location>  
    <location path="users">  
    <system.web>  
    <authorization>  
    <allow roles="User"/>  
    <deny users="*"/>  
    </authorization>  
    </system.web>  
    </location>  
    </configuration>  
    还可使用BasePage判断,所有页面继承BasePage  
    public class BasePage : System.Web.UI.Page  
      {  
        
        
      public BasePage()  
      {  
        
      }  
      protected override void OnInit(EventArgs O)  
      {  
      if (base.Session["UserId"] == null || base.Session["UserId"].ToString().Equals(""))  
      {  
      Response.Redirect("~/Error.aspx");  
      }  
      }  
    或IhhtpModule    FormsAuthentication.SignOut();
      Session.Clear();
      Session.Abandon(); 
    转自http://topic.csdn.net/u/20091117/12/a291373f-4c07-416f-9986-8b1d7ed857ed.html
      

  8.   

    也可以用httpxmlRequest对象定时像页面发送请求。配合web。config的session设置联合使用
      

  9.   

    function createXmlHttpRequest() {}
    function Reconnect() {
        var url = 'xj.aspx'
        xmlHttp = createXmlHttpRequest()
        xmlHttp.open('GET', url, true)
        xmlHttp.send(null)
        //只要求与服务器联系,不要求返回数据,因此,不进行返回处理
    }function refreshme() {
        setInterval("Reconnect();", 50000); //此时间根据实际情况调整
    }
      

  10.   

    Session 是在服务器端,跟客户端没关系。
      

  11.   

    //Session是服务器(也就是运行你的VB代码的那台机器)内存里的一个用户级别的全局变量(就是对当前在同一电脑同一浏览器上请求页面的用户有效,只要你不关闭浏览器)当然,这些是我自己定义的,为了说明通俗一些,所以不存在兼容性问题//因它是缓存在内存地址里的,所以很多情况会引起它过期(操作系统会根据内存的使用量,而用一定的算法把一些不常用的数据挤出内存,腾出内存资源分配给另一些指令),如果不作配置,则Session默认的过期时间,在VS 2005时期是15分钟,我好像记得书上是这么说的,但后面版本的却没注意
      

  12.   

    session是服务器端的会话层!是一个全局变量。他是有过期时间的不懂别乱说。。