本文介绍了如何使用ASP,会话和HTML向cookis添加线索?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在asp中有这个页面的cookies



用户名=会话(  名称
密码=会话( 密码

Response.Write( < ; div dir =& ltr>
会话。超时= 10
会话( Date )= Date()
Session( 时间)=时间( )
Response.Write( Welcome:& username)
回复.Write( < / br>
Response.Write( 日期登录:&会话( 日期))
Response.Write( < / br>
Response.Write( 时间登录:& Session( 时间))
Session.Abandon
Response.Write( < / div>

Response.Cookies( username)。 add (用户名)
Response.Cookies( password)。 add (密码)
Response.Cookies( date)。 add (会话( Date))
Response.Cookies( time). add (会话( time ))

' 仅当您要查看cookies $ b $时Request.Cookies中的每个x的b
dim x

response.write(< p>)
Response.Write(username =& Response.Cookies(用户名)& password =& Response.Cookies(密码)& 日期=& Request.Cookies时(日期)及time =& Request.Cookies(time)& < br>)
response.write< / p>
next





它不起作用,因为add(field name)



和我想要做的是将字段添加到cookie列表中



并在之后显示它们那我怎么用asp做的呢?



我尝试过:



i试试这个白色循环工作但只有一行:



response.write(



回复.Write(username =& Response.Cookies(username)&password =& Response.Cookies(password)&Date =& Request.Cookies(date)& ;time =& Request.Cookies(time)&


response.write





如果我用循环执行此操作,则显示相同的行5次

解决方案

i have this page in asp with the cookies

username = Session("Name")
password = Session("password")

Response.Write("<div dir=" & "ltr>")
    Session.Timeout=10
    Session("Date")= Date()
    Session("Time")= Time()
    Response.Write("Welcome : " & username)
    Response.Write("</br>")
    Response.Write("Date Login : " & Session("Date"))
    Response.Write("</br>")
    Response.Write("Time Login : " & Session("Time"))
    Session.Abandon
Response.Write("</div>")

Response.Cookies("username").add(username)
Response.Cookies("password").add(password)
Response.Cookies("date").add(Session("Date"))
Response.Cookies("time").add(Session("time"))

'only if you want to see the cookies

dim x
for each x in Request.Cookies
    response.write("<p>")
    Response.Write("username= " & Response.Cookies("username") & " password= " & Response.Cookies("password") & " Date= "& Request.Cookies("date")& " time= " & Request.Cookies("time") & "<br>")
    response.write "</p>"
next



its dont work because the add("field name")

and what i want to do is to add thoes field to the cookies list

and show them after that so how i do that using asp?

What I have tried:

i try this its whitout the loop work but only for one row :

response.write("

")
Response.Write("username= " & Response.Cookies("username") & " password= " & Response.Cookies("password") & " Date= "& Request.Cookies("date")& " time= " & Request.Cookies("time") & "
")
response.write "

"

and if i do this with a loop its show the same row 5 times

解决方案


这篇关于如何使用ASP,会话和HTML向cookis添加线索?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 09:08