会话变量被截断并让我发疯 [英] Session Variable gets truncated and drives me crazy
问题描述
请帮助我
我正在做的事情我虽然真的很容易但是它让我感动
疯狂
完整的代码在电子邮件的末尾
(我的意思是新闻组文章),
i总是使用Option Explicit
和Response.Expires = -1,
根本没有包含,
没有任何其他asp页面的副作用,
没有global.asa之类的东西。
它在我的IIS 5服务器上
托管在Win2000服务器SP3上。
我正在使用IE6-SP1
这里有一步一步的解释:
我打电话给 http://192.168.0.102/Page.asp&driving=me&crazy=true
我记下会话变量内容
Response.Write Session(" DoltharzURL")& "< BR>"
<! - 下一行真的很空白 - >
((直到它'')第一次,这里什么也没有))
<! - 以前的线路真的是空白 - >
i把当前的页面地址在会话中使用其查询字符串
变量
Dim tmp
tmp = Request.ServerVariables(" SCRIPT_NAME")& "?" &
Request.ServerVariables(" QUERY_STRING")& "
会话(" DoltharzURL")= tmp& "
& ""最后是确保数据真的是一个字符串而不是
a引用一个对象,即使它没有必要,直到它已经
a连接其他的东西......太多不能伤害。
然后我写下会话变量内容,只是为了确保它真的很好
在会话变量中,它确实存在。
Response.Write Session(DoltharzURL)& "< BR>"
/Page.asp?driving=me&crazy=true
然后我重新打开相同的页面写下会话变量
内容
Response.Write Session(" DoltharzURL")& "< BR>"
/Page.asp?
为什么查询字符串不见了???????? ????
更奇怪的是,如果我以这种方式设置会话变量内容
会话(DoltharzURL)=" BEGIN" &安培; tmp& 结束
我最终会结束
BEGIN / Page.asp?END
即使一直都是Response.Write填充会话变量
内容定义为我提供了正确的内容
更进一步,我手动将内容设置为
" ; /Page.asp?driving = me& crazy = true"
没有调用任何其他函数(ServerVariables),这里它是
工作正常。
所以我对自己说,在{BEEP}结束时有一个{BEEP} \ 0
Request.ServerVariables("")^所以我输入了一个函数,写下了
字节的内容,逐字节给出所有ascii代码...
<%
对于i = 1到len(arg)
Response.Write i& , &安培; mid(arg,i,1)& , &安培; asc(mid(arg,i,1))
& "< BR>"
next
%>
它给了我(假的)
1,/,47
2,p,99
3,a,115
4, g,115
5,e,116
6 ,.
7,a
8,s
9,p
10,?
11,d
12,r
13,i
14,v
15,i
16,n
17,g
18,=
19,m
20,e
21,&
22,c
23,r
24,a
25,z
26,y
27,=
28,t
29,r
30,u
31,e />
在char数1..2..3..4..5 .. ...... ..31..32
中没有差距
" / page.asp?之间没有\ o和Drime = me& Crazy = true
所以我虽然是?所以我用XYZ替换它结束了
/Page.aspXYZ
这个变量被称为DoltharzURL,我认为它不是保留
关键字,如果是......我很幸运。
请帮助我
<%
''Rem * * *第二页打电话给QUERYSTRING两个ARG
''Rem * * *例如:Page.asp?arg1 = value1& arg2 = value2
Dim tmp
tmp = Session(" DoltharzURL)
Response.Write" tmp =" &安培; tmp& "< BR>"
Response.Write Session(" DoltharzURL")& "< BR>"
Response.Write Session.SessionID& "< BR>"
tmp = Request.ServerVariables(" SCRIPT_NAME")& "?" &
Request.ServerVariables(" QUERY_STRING")& "
会话(" DoltharzURL")= tmp& "
Response.Write" tmp =" &安培; tmp& "< BR>"
Response.Write Session(" DoltharzURL")& "< BR>"
Response.Write Session.SessionID& "< BR>"
%>
回复我的个人电子邮件和此群组...
>
doltharz at hotmail dot com
我不是GURU,也不是专家或类似的东西。
我只是一个热情的程序员。
Doltharz
嗨
我们似乎遇到了同样的问题,请阅读我的帖子(发布在您下面的4个帖子)会话变量的价值会丢失。这是一个奇怪的问题。
" doltharz" <做****** @ hotmail.com>在消息中写道
新闻:n8 ******************************** @ 4ax.com ...请帮助我
我正在做的事我虽然真的很容易但是它让我感到疯狂
(我的意思是新闻组文章),
我总是使用Option Explicit
和Response.Expires = -1,
没有任何其他asp页面的副作用,
没有global.asa之类的东西。
它在我的IIS 5服务器上/>托管在Win2000服务器SP3上。
我正在使用IE6-SP1
这里有一步一步解释:
我打电话给 http://192.168.0.102/Page.asp&driving=me& crazy = true
我写下会话变量内容
Response.Write Session(" DoltharzURL)& < BR>"
<! - 下一行真是空白 - >
((直到这是第一次,这里什么都没有) ))
<! - 以前的线路真的很空白 - >
我把当前页面地址及其查询字符串放在一个会话中
变量
Dim tmp
tmp = Request.ServerVariables(" SCRIPT_NAME")& "?" &
Request.ServerVariables(" QUERY_STRING")& "
会话(DoltharzURL)= tmp& "
& ""最后是要确保数据真的是一个字符串,而不是对象的引用,即使它已经没有必要,直到它已经是其他东西的串联......太多不能伤害。
然后我写下会话变量内容,只是为了确保它真的在会话变量中确实存在并且确实存在。<响应。写入会话(DoltharzURL)& "< BR>"
/ page.asp?driving=me&crazy=true
然后我重新打开会写下会话变量的SAME页面<内容
Response.Write Session(DoltharzURL)& "< BR>"
/ page.asp?
为什么查询字符串不见了????????????
甚至更奇怪,如果我以这种方式设置会话变量内容
会话(DoltharzURL)=" BEGIN" &安培; tmp& 结束
我最终会以
BEGIN / Page.asp结束吗?END
即使一直在响应会话变量
内容定义的Response.Write给了我正确的内容
更进一步,我手动将内容设置为
" /Page.asp?driving = me& crazy = true"
而不调用任何其他功能( ServerVariables)并且在这里工作正常。
所以我对自己说,在{BEEP}结尾有一个{BEEP} \0
Request.ServerVariables("")^所以我输入一个函数,按字节写下字符串的内容,给出所有ascii代码...
< %
对于i = 1到len(arg)
Response.Write i& , &安培; mid(arg,i,1)& , &安培; asc(mid(arg,i,1))
& < BR>"
下一页
%>
它给了我(假的)
1,/,47
2,p,99
3,a,115
4,g,115
5,e,116
6,。
7,a /> 8,s
9,p
10,?
11,d
12,r
13,i
14,v
15,i
16,n
17,g
18,=
19,m
20,e /> 21,&
22,c
23,r
24,a
25,z
26,y
27,=
28,t
29,你好,在炭烬计数1..2..3..4 ...... 5 ...... ..31..32
// page.asp?之间没有\ o和Drime = me& Crazy = true
所以我虽然是?所以我用XYZ替换它最终得到
/ Page.aspXYZ
该变量被称为DoltharzURL,我假设它不是保留
关键字,如果是...我很高兴幸运的家伙。
请帮助我
<%
''Rem * * *在QUERYSTRING上用两个ARG打开第二页
' 'Rem * * *例如:Page.asp?arg1 = value1& arg2 = value2
Dim tmp
tmp = Session(" DoltharzURL")
Response.Write" TMP =" &安培; tmp& < BR>"
Response.Write Session(" DoltharzURL")& "< BR>"
Response.Write Session.SessionID& < BR>"
tmp = Request.ServerVariables(" SCRIPT_NAME")& "?" &
Request.ServerVariables(" QUERY_STRING")& "
会话(" DoltharzURL")= tmp& "
Response.Write" tmp =" &安培; tmp& < BR>"
Response.Write Session(" DoltharzURL")& "< BR>"
Response.Write Session.SessionID& "< BR>"
%>
回复我的个人电子邮件和此群组...
doltharz at hotmail dot com
我不是GURU,也不是专家或类似的东西。
我只是一个热情的程序员。
Doltharz
Julian写道:嗨
看来我们有同样的问题,请看我的帖子(4帖子)在你下面)
会话变量的值会丢失。这是一个奇怪的问题。
doltharz <做****** @ hotmail.com>在消息中写道
新闻:n8 ******************************** @ 4ax.com ... < blockquote class =post_quotes>请帮助我
我正在做的事情我虽然真的很容易但是它让我感到疯狂
完整的代码是在电子邮件的末尾
(我的意思是新闻组文章),
我总是使用Option Explicit
和Response.Expires = -1,
没有任何包含,
没有任何其他asp页面的副作用,
没有global.asa没有这样的。
它在我的IIS 5服务器上
托管一台Win2000服务器SP3。
我正在使用IE6-SP1
这里有一步一步的解释:
我打电话给 http://192.168.0.102/Page.asp&driving=me&crazy=true
这是一个错字吗?它应该是:
http://192.168。 0.102 / Page.asp?driving = me& crazy = true
Bob Barrows
为了给我带来一点点热情,但也许可以帮助你们中的一些人来解决这个问题:
请记住那些不是科学的防弹副本/粘贴的代码
但是人类打印的文章...如果打字错误让你感到异常,请不要火焰。
使用QUERY_STRING
" / page.asp?80"按顺序
<%
Dim tmp
tmp = Request.ServerVariables(" SCRIPT_NAME")& "?" &
Request.ServerVariables(" SERVER_PORT")& "
会话(" DoltharzURL")= tmp& "
%>
这个在使用QUERY_STRING时不起作用
只有一个 /Page.asp?"按顺序
<%
Dim tmp
tmp = Request.ServerVariables(" SCRIPT_NAME")& "?" &
Request.ServerVariables(" QUERY_STRING")& "
会话(" DoltharzURL")= tmp& "
%>
这个在使用QUERY_STRING时不起作用
只有一个 ?"顺便说一句
<%
Dim tmp
tmp ="?" &安培; Request.ServerVariables(" QUERY_STRING")& "
会话(" DoltharzURL")= tmp& "
%>
问题可能是QUERY_STRING服务器变量而不是
会话变量。
希望能帮助那些帮助我们的人;)
Doltharz
周五,2003年8月1日05:04:40 -0400,doltharz< do ****** @ hotmail.com>
写道:
请帮助我
我正在做的事情我虽然真的很容易,但它让我感到很疯狂
完整的代码在电子邮件的最后
(我的意思是新闻组文章),
我总是使用Option Explicit
和Response.Expires = -1,
根本没有包含,
没有任何其他asp页面的副作用,
没有global.asa之类的东西。
它位于我的IIS 5服务器上,托管在Win2000服务器SP3上。
我正在使用IE6-SP1
这里有一步一步的解释:
我打电话给 http://192.168.0.102/Page.asp&driving=me&crazy=true
我写下来会话变量内容
Response.Write Session(DoltharzURL)& < BR>"
<! - 下一行真是空白 - >
((直到这是第一次,这里什么都没有) ))
<! - 以前的线路真的很空白 - >
我把当前页面地址及其查询字符串放在一个会话中
变量
Dim tmp
tmp = Request.ServerVariables(" SCRIPT_NAME")& "?" &
Request.ServerVariables(" QUERY_STRING")& "
会话(DoltharzURL)= tmp& "
& ""最后是要确保数据真的是一个字符串,而不是对象的引用,即使它已经没有必要,直到它已经是其他东西的串联......太多不能伤害。
然后我写下会话变量内容,只是为了确保它真的在会话变量中确实存在并且确实存在。<响应。写入会话(DoltharzURL)& "< BR>"
/ page.asp?driving=me&crazy=true
然后我重新打开会写下会话变量的SAME页面<内容
Response.Write Session(DoltharzURL)& "< BR>"
/ page.asp?
为什么查询字符串不见了????????????
甚至更奇怪,如果我以这种方式设置会话变量内容
会话(DoltharzURL)=" BEGIN" &安培; tmp& 结束
我最终会以
BEGIN / Page.asp结束吗?END
即使一直在响应会话变量
内容定义的Response.Write给了我正确的内容
更进一步,我手动将内容设置为
" /Page.asp?driving = me& crazy = true"
而不调用任何其他功能( ServerVariables)并且在这里工作正常。
所以我对自己说,在{BEEP}结尾有一个{BEEP} \0
Request.ServerVariables("")^所以我输入一个函数,按字节写下字符串的内容,给出所有ascii代码...
< %
对于i = 1到len(arg)
Response.Write i& , &安培; mid(arg,i,1)& , &安培; asc(mid(arg,i,1))
& < BR>"
下一页
%>
它给了我(假的)
1,/,47
2,p,99
3,a,115
4,g,115
5,e,116
6,。
7,a /> 8,s
9,p
10,?
11,d
12,r
13,i
14,v
15,i
16,n
17,g
18,=
19,m
20,e /> 21,&
22,c
23,r
24,a
25,z
26,y
27,=
28,t
29,你好,在炭烬计数1..2..3..4 ...... 5 ...... ..31..32
// page.asp?之间没有\ o和Drime = me& Crazy = true
所以我虽然是?所以我用XYZ替换它最终得到
/ Page.aspXYZ
该变量被称为DoltharzURL,我假设它不是保留
关键字,如果是...我很高兴幸运的家伙。
请帮助我
<%
''Rem * * *在QUERYSTRING上用两个ARG打开第二页
' 'Rem * * *例如:Page.asp?arg1 = value1& arg2 = value2
Dim tmp
tmp = Session(" DoltharzURL")
Response.Write" TMP =" &安培; tmp& < BR>"
Response.Write Session(" DoltharzURL")& "< BR>"
Response.Write Session.SessionID& < BR>"
tmp = Request.ServerVariables(" SCRIPT_NAME")& "?" &
Request.ServerVariables(" QUERY_STRING")& "
会话(" DoltharzURL")= tmp& "
Response.Write" tmp =" &安培; tmp& < BR>"
Response.Write Session(" DoltharzURL")& "< BR>"
Response.Write Session.SessionID& "< BR>"
%>
回复我的个人电子邮件和此群组...
doltharz at hotmail dot com
我不是GURU,也不是专家或类似的东西。
我只是一个热情的程序员。
Doltharz
我不是GURU,也不是专家或类似的东西。
我只是一个热情的程序员。
Doltharz
Please Help me
i''m doing something i though was to be REALLY EASY but it drives me
crazy
The complete code is at the end of the email
(i mean newsgroup article),
i always use Option Explicit
and Response.Expires=-1,
there is NO INCLUDE at all,
no side effect from any other asp page,
no global.asa of nothing like that.
It''s on MY IIS 5 server
hosted on a Win2000 server SP3.
I''m using IE6-SP1
Here it goes for step by step explanation:
I call http://192.168.0.102/Page.asp&driving=me&crazy=true
I write down session variable content
Response.Write Session("DoltharzURL") & "<BR>"
<!-- THE NEXT LINE IS REALLY BLANK -->
(( Till it''s the first time, there is nothing here ))
<!-- THE PREVIOUS LINE IS REALLY BLANK -->
i put the current page address with its querystring in a session
variable
Dim tmp
tmp = Request.ServerVariables("SCRIPT_NAME") & "?" &
Request.ServerVariables("QUERY_STRING") & ""
Session("DoltharzURL") = tmp & ""
The & "" at the end is to be sure the data is really a string and not
a reference to an object even if it''s not necessary till it''s already
a concatenation of something else... too much can''t hurt.
Then i write down session variable content, just to be sure it''s realy
in the session variable and it''s really there.
Response.Write Session("DoltharzURL") & "<BR>"
/Page.asp?driving=me&crazy=true
Then i REOPEN the SAME page which does write down the session variable
content
Response.Write Session("DoltharzURL") & "<BR>"
/Page.asp?
Why is the querystring gone????????????
Even stranger, if i set the Session Variable content this way
Session("DoltharzURL") = "BEGIN" & tmp & "END"
I''ll end up with
BEGIN/Page.asp?END
Even if all the time Response.Write folling the Session Variable
content definition gives me the right content
Going even further, i manually set the content to
"/Page.asp?driving=me&crazy=true"
without calling any other function (ServerVariables) and here it''s
working fine.
So i said to myself, there is a {BEEP} \0 at the end of that {BEEP}
Request.ServerVariables("")^so i''ve type a function that write down
the content of the string byte by byte giving all ascii code...
<%
For i = 1 to len(arg)
Response.Write i & ", " & mid(arg,i,1) & ", " & asc(mid(arg,i,1))
& "<BR>"
next
%>
it gives me (fake one)
1, /, 47
2, p, 99
3, a, 115
4, g, 115
5, e, 116
6, .
7, a
8, s
9, p
10, ?
11, d
12, r
13, i
14, v
15, i
16, n
17, g
18, =
19, m
20, e
21, &
22, c
23, r
24, a
25, z
26, y
27, =
28, t
29, r
30, u
31, e
with no gap in the char count 1..2..3..4..5.. ... ..31..32
there is no \o between "/page.asp?" and "Drime=me&Crazy=true"
So i though it was the "?" so i replace it by "XYZ" to end up with
/Page.aspXYZ
The variable is called DoltharzURL which i assumed isn''t a reserved
keyword, if it is... i''m a very lucky guy.
Please Help me
<%
''Rem * * * CALL THIS PAGE TWICE WITH TWO ARGs ON THE QUERYSTRING
''Rem * * * e.g.: Page.asp?arg1=value1&arg2=value2
Dim tmp
tmp = Session("DoltharzURL")
Response.Write "tmp=" & tmp & "<BR>"
Response.Write Session("DoltharzURL") & "<BR>"
Response.Write Session.SessionID & "<BR>"
tmp = Request.ServerVariables("SCRIPT_NAME") & "?" &
Request.ServerVariables("QUERY_STRING") & ""
Session("DoltharzURL") = tmp & ""
Response.Write "tmp=" & tmp & "<BR>"
Response.Write Session("DoltharzURL") & "<BR>"
Response.Write Session.SessionID & "<BR>"
%>
Reply to both my personnal email and this group...
doltharz at hotmail dot com
I''m not a GURU nor an EXPERT or something like that.
I''m just a passionnate programmer.
Doltharz
Hi
It seems we have the same problem, read my post (4 posting below you) "the
value of session variables gets lost". It is a strange problem.
"doltharz" <do******@hotmail.com> wrote in message
news:n8********************************@4ax.com...Please Help me
i''m doing something i though was to be REALLY EASY but it drives me
crazy
The complete code is at the end of the email
(i mean newsgroup article),
i always use Option Explicit
and Response.Expires=-1,
there is NO INCLUDE at all,
no side effect from any other asp page,
no global.asa of nothing like that.
It''s on MY IIS 5 server
hosted on a Win2000 server SP3.
I''m using IE6-SP1
Here it goes for step by step explanation:
I call http://192.168.0.102/Page.asp&driving=me&crazy=true
I write down session variable content
Response.Write Session("DoltharzURL") & "<BR>"
<!-- THE NEXT LINE IS REALLY BLANK -->
(( Till it''s the first time, there is nothing here ))
<!-- THE PREVIOUS LINE IS REALLY BLANK -->
i put the current page address with its querystring in a session
variable
Dim tmp
tmp = Request.ServerVariables("SCRIPT_NAME") & "?" &
Request.ServerVariables("QUERY_STRING") & ""
Session("DoltharzURL") = tmp & ""
The & "" at the end is to be sure the data is really a string and not
a reference to an object even if it''s not necessary till it''s already
a concatenation of something else... too much can''t hurt.
Then i write down session variable content, just to be sure it''s realy
in the session variable and it''s really there.
Response.Write Session("DoltharzURL") & "<BR>"
/Page.asp?driving=me&crazy=true
Then i REOPEN the SAME page which does write down the session variable
content
Response.Write Session("DoltharzURL") & "<BR>"
/Page.asp?
Why is the querystring gone????????????
Even stranger, if i set the Session Variable content this way
Session("DoltharzURL") = "BEGIN" & tmp & "END"
I''ll end up with
BEGIN/Page.asp?END
Even if all the time Response.Write folling the Session Variable
content definition gives me the right content
Going even further, i manually set the content to
"/Page.asp?driving=me&crazy=true"
without calling any other function (ServerVariables) and here it''s
working fine.
So i said to myself, there is a {BEEP} \0 at the end of that {BEEP}
Request.ServerVariables("")^so i''ve type a function that write down
the content of the string byte by byte giving all ascii code...
<%
For i = 1 to len(arg)
Response.Write i & ", " & mid(arg,i,1) & ", " & asc(mid(arg,i,1))
& "<BR>"
next
%>
it gives me (fake one)
1, /, 47
2, p, 99
3, a, 115
4, g, 115
5, e, 116
6, .
7, a
8, s
9, p
10, ?
11, d
12, r
13, i
14, v
15, i
16, n
17, g
18, =
19, m
20, e
21, &
22, c
23, r
24, a
25, z
26, y
27, =
28, t
29, r
30, u
31, e
with no gap in the char count 1..2..3..4..5.. ... ..31..32
there is no \o between "/page.asp?" and "Drime=me&Crazy=true"
So i though it was the "?" so i replace it by "XYZ" to end up with
/Page.aspXYZ
The variable is called DoltharzURL which i assumed isn''t a reserved
keyword, if it is... i''m a very lucky guy.
Please Help me
<%
''Rem * * * CALL THIS PAGE TWICE WITH TWO ARGs ON THE QUERYSTRING
''Rem * * * e.g.: Page.asp?arg1=value1&arg2=value2
Dim tmp
tmp = Session("DoltharzURL")
Response.Write "tmp=" & tmp & "<BR>"
Response.Write Session("DoltharzURL") & "<BR>"
Response.Write Session.SessionID & "<BR>"
tmp = Request.ServerVariables("SCRIPT_NAME") & "?" &
Request.ServerVariables("QUERY_STRING") & ""
Session("DoltharzURL") = tmp & ""
Response.Write "tmp=" & tmp & "<BR>"
Response.Write Session("DoltharzURL") & "<BR>"
Response.Write Session.SessionID & "<BR>"
%>
Reply to both my personnal email and this group...
doltharz at hotmail dot com
I''m not a GURU nor an EXPERT or something like that.
I''m just a passionnate programmer.
Doltharz
Julian wrote:Hi
It seems we have the same problem, read my post (4 posting below you)
"the value of session variables gets lost". It is a strange problem.
"doltharz" <do******@hotmail.com> wrote in message
news:n8********************************@4ax.com...Please Help me
i''m doing something i though was to be REALLY EASY but it drives me
crazy
The complete code is at the end of the email
(i mean newsgroup article),
i always use Option Explicit
and Response.Expires=-1,
there is NO INCLUDE at all,
no side effect from any other asp page,
no global.asa of nothing like that.
It''s on MY IIS 5 server
hosted on a Win2000 server SP3.
I''m using IE6-SP1
Here it goes for step by step explanation:
I call http://192.168.0.102/Page.asp&driving=me&crazy=true
Is this a typo? It should be:
http://192.168.0.102/Page.asp?driving=me&crazy=true
Bob Barrows
To drive me a little bit more craze but maybe to help some of you to
pin point the problem:
Remember that those are not scientific bullet proof copy/pasted code
but human typed article... dont flame if a typo makes it way to you.
This one works when not using the QUERY_STRING
"/page.asp?80" makes it way
<%
Dim tmp
tmp = Request.ServerVariables("SCRIPT_NAME") & "?" &
Request.ServerVariables("SERVER_PORT") & ""
Session("DoltharzURL") = tmp & ""
%>
This one doesn''t work when using the QUERY_STRING
Only a "/Page.asp?" makes it way
<%
Dim tmp
tmp = Request.ServerVariables("SCRIPT_NAME") & "?" &
Request.ServerVariables("QUERY_STRING") & ""
Session("DoltharzURL") = tmp & ""
%>
This one doesn''t work when using the QUERY_STRING
Only a "?" makes it way
<%
Dim tmp
tmp = "?" & Request.ServerVariables("QUERY_STRING") & ""
Session("DoltharzURL") = tmp & ""
%>
Maybe the problem is the QUERY_STRING server variable and not the
Session Variable.
Hope that helps those who are tring to help us ;)
Doltharz
On Fri, 01 Aug 2003 05:04:40 -0400, doltharz <do******@hotmail.com>
wrote:
Please Help me
i''m doing something i though was to be REALLY EASY but it drives me
crazy
The complete code is at the end of the email
(i mean newsgroup article),
i always use Option Explicit
and Response.Expires=-1,
there is NO INCLUDE at all,
no side effect from any other asp page,
no global.asa of nothing like that.
It''s on MY IIS 5 server
hosted on a Win2000 server SP3.
I''m using IE6-SP1
Here it goes for step by step explanation:
I call http://192.168.0.102/Page.asp&driving=me&crazy=true
I write down session variable content
Response.Write Session("DoltharzURL") & "<BR>"
<!-- THE NEXT LINE IS REALLY BLANK -->
(( Till it''s the first time, there is nothing here ))
<!-- THE PREVIOUS LINE IS REALLY BLANK -->
i put the current page address with its querystring in a session
variable
Dim tmp
tmp = Request.ServerVariables("SCRIPT_NAME") & "?" &
Request.ServerVariables("QUERY_STRING") & ""
Session("DoltharzURL") = tmp & ""
The & "" at the end is to be sure the data is really a string and not
a reference to an object even if it''s not necessary till it''s already
a concatenation of something else... too much can''t hurt.
Then i write down session variable content, just to be sure it''s realy
in the session variable and it''s really there.
Response.Write Session("DoltharzURL") & "<BR>"
/Page.asp?driving=me&crazy=true
Then i REOPEN the SAME page which does write down the session variable
content
Response.Write Session("DoltharzURL") & "<BR>"
/Page.asp?
Why is the querystring gone????????????
Even stranger, if i set the Session Variable content this way
Session("DoltharzURL") = "BEGIN" & tmp & "END"
I''ll end up with
BEGIN/Page.asp?END
Even if all the time Response.Write folling the Session Variable
content definition gives me the right content
Going even further, i manually set the content to
"/Page.asp?driving=me&crazy=true"
without calling any other function (ServerVariables) and here it''s
working fine.
So i said to myself, there is a {BEEP} \0 at the end of that {BEEP}
Request.ServerVariables("")^so i''ve type a function that write down
the content of the string byte by byte giving all ascii code...
<%
For i = 1 to len(arg)
Response.Write i & ", " & mid(arg,i,1) & ", " & asc(mid(arg,i,1))
& "<BR>"
next
%>
it gives me (fake one)
1, /, 47
2, p, 99
3, a, 115
4, g, 115
5, e, 116
6, .
7, a
8, s
9, p
10, ?
11, d
12, r
13, i
14, v
15, i
16, n
17, g
18, =
19, m
20, e
21, &
22, c
23, r
24, a
25, z
26, y
27, =
28, t
29, r
30, u
31, e
with no gap in the char count 1..2..3..4..5.. ... ..31..32
there is no \o between "/page.asp?" and "Drime=me&Crazy=true"
So i though it was the "?" so i replace it by "XYZ" to end up with
/Page.aspXYZ
The variable is called DoltharzURL which i assumed isn''t a reserved
keyword, if it is... i''m a very lucky guy.
Please Help me
<%
''Rem * * * CALL THIS PAGE TWICE WITH TWO ARGs ON THE QUERYSTRING
''Rem * * * e.g.: Page.asp?arg1=value1&arg2=value2
Dim tmp
tmp = Session("DoltharzURL")
Response.Write "tmp=" & tmp & "<BR>"
Response.Write Session("DoltharzURL") & "<BR>"
Response.Write Session.SessionID & "<BR>"
tmp = Request.ServerVariables("SCRIPT_NAME") & "?" &
Request.ServerVariables("QUERY_STRING") & ""
Session("DoltharzURL") = tmp & ""
Response.Write "tmp=" & tmp & "<BR>"
Response.Write Session("DoltharzURL") & "<BR>"
Response.Write Session.SessionID & "<BR>"
%>
Reply to both my personnal email and this group...
doltharz at hotmail dot com
I''m not a GURU nor an EXPERT or something like that.
I''m just a passionnate programmer.
Doltharz
I''m not a GURU nor an EXPERT or something like that.
I''m just a passionnate programmer.
Doltharz
这篇关于会话变量被截断并让我发疯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!