从包含文件中编写cookie [英] Writing cookies from include file

查看:65
本文介绍了从包含文件中编写cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


任何人都知道这是否可行?如果是这样,

cookie将在哪个页面上? ..在调用包含

文件中定义的函数的页面上?


提前感谢..


-BB

解决方案



" Brian Burgess" < BB ******** @ hotmail.com>在消息中写道

新闻:5k ******************************** @ 4ax.com ...

大家好,

任何人都知道这是否可行?


是的。包含文件是调用页面的一部分,用于所有意图和

目的。


如果是这样,cookie将在哪个页面上? ..在调用include
文件中定义的函数的页面上?




你是什么意思,它会是什么页面? Cookie在客户端上,然后可以从您域中的任何页面获得
。示例


page1.asp包含一个名为cookie.asp的文件,它写了一个cookie。

page2.asp如果你想要它可以拉那个cookie。


雷在家


这是最后一页总是很重要,而不是包括。
< br $>
-

Manohar Kamath

编辑,.netBooks
www.dotnetbooks.com

" Brian Burgess" < BB ******** @ hotmail.com>在消息中写道

新闻:5k ******************************** @ 4ax.com ...

大家好,

任何人都知道这是否可行?如果是这样,
cookie将在哪个页面上? ..在调用include
文件中定义的函数的页面上?

提前感谢..

-BB



?很酷。


所以我可以这样做:

<%

Response.Cookies(" cookie1")=" blah"

Response.Cookies(" cookie1")。Expires = DateAdd(" n",15,Now)

Server.Execute(" page2.asp" ;)

...

...

%>


然后在第2页.asp我可以这样做:

<%

Dim strCookie1

strCookie1 = Request.Cookies(" cookie1")

%>


这会有效吗?到目前为止,它还不适合我,但也许我还有其他问题。


我尝试了CodeProject的一些示例cookie代码

(''http://www.codeproject.com/asp/cookies.asp'')。这工作正常,

我自己的代码与此类似,不是写cookie。 :-(


谢谢,


-BB


2003年9月9日星期二23 :43:06-0400,Ray at home< myfirstname at lane

34.komm>写道:


" Brian Burgess"< bb ******** @ hotmail.com>在消息中写道
新闻:5k ********************* ***********@4ax.com ..。

大家好,

任何人都知道这是否可行?



是的。包含文件是调用页面的一部分,用于所有意图和
目的。
如果是这样,

cookie是吗?..在调用include
文件中定义的函数的页面上?



你是什么意思,它会是什么页面?cookie是在客户端上,
可以从您域中的任何页面获得。例子

page1.asp包含一个名为cookie.asp的文件,它写了一个cookie。
page2.asp如果你愿意,可以拉那个饼干蚂蚁吧。

雷在家




Hi all,

Anyone know if this is possible? If so, on which page would the
cookie be? .. On the page calling a function defined in the include
file?

thanks in advance..

-BB

解决方案


"Brian Burgess" <bb********@hotmail.com> wrote in message
news:5k********************************@4ax.com...

Hi all,

Anyone know if this is possible?
Yes. The include file is part of the calling page, for all intents and
purposes.

If so, on which page would the cookie be? .. On the page calling a function defined in the include
file?



What do you mean, what page would it be on? The cookie is on the client and
is available from any page in your domain then. Example

page1.asp includes a file called cookie.asp, which writes a cookie.
page2.asp can pull that cookie if you want it to.

Ray at home


It''s the final page that always counts, not the includes.

--
Manohar Kamath
Editor, .netBooks
www.dotnetbooks.com
"Brian Burgess" <bb********@hotmail.com> wrote in message
news:5k********************************@4ax.com...

Hi all,

Anyone know if this is possible? If so, on which page would the
cookie be? .. On the page calling a function defined in the include
file?

thanks in advance..

-BB



Really? cool.

So I can do:
<%
Response.Cookies("cookie1") = "blah"
Response.Cookies("cookie1").Expires=DateAdd("n", 15, Now)
Server.Execute("page2.asp")
...
...
%>

Then in page2.asp I can do something like:
<%
Dim strCookie1
strCookie1 = Request.Cookies("cookie1")
%>

This will work? It has not been for me so far, but maybe I have
other issues going on.

I tried some sample cookie code from CodeProject
(''http://www.codeproject.com/asp/cookies.asp''). This is working fine,
my own code similar to this is not writing the cookie. :-(

Thanks,

-BB

On Tue, 9 Sep 2003 23:43:06 -0400, "Ray at home" <myfirstname at lane
34 . komm> wrote:


"Brian Burgess" <bb********@hotmail.com> wrote in message
news:5k********************************@4ax.com.. .

Hi all,

Anyone know if this is possible?



Yes. The include file is part of the calling page, for all intents and
purposes.

If so, on which page would the

cookie be? .. On the page calling a function defined in the include
file?



What do you mean, what page would it be on? The cookie is on the client and
is available from any page in your domain then. Example

page1.asp includes a file called cookie.asp, which writes a cookie.
page2.asp can pull that cookie if you want it to.

Ray at home




这篇关于从包含文件中编写cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆