Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Cookies & blank spaces


Message #1 by "Scott Vincent" <sdv@s...> on Fri, 23 Feb 2001 20:06:16
Hi All, 



In my .asp page I set the fields to write a cookie. 

When I close my browser and return to the page only information up to the 

first blank space shows. 



example: 

1)Initial 'login' page... Name: Scott Vincent 

2)Return to page reading from cookie: Name: Scott 



On my local machine the cookie value reads 'scott'. The space 

and 'vincent' were deleted.



What can I do to have all the information in a field return with the 

spaces intact? 



Here's my code... 



1) Login.asp (input box): 

<INPUT id=Name name=r_Name maxLength=30 

            size=30 value= <%= Request.Cookies("Name")%> 



<< submit >> to return.asp where I have this statement >> 



2) Return.asp: 

<% 

'get value

Name = Request.Form("r_Name") 

'set session value

Session("Name") = Name 

'write cookie

Response.Cookies("Name") = Name 



... write this out for all other key/value pairs... 



' Set path for cookies 

For Each cookie In Response.Cookies 

Response.Cookies(cookie).Path ="/" 

Response.Cookies(cookie).Expires = Date +365 

Next 

%> 





Thanks,

Scott
Message #2 by "JstMeHr4u3" <jstmehr4u3@h...> on Fri, 23 Feb 2001 12:43:25 -0800
You Quotes " to bracket your values and definitions. This problem was just

posted last week or so.



> Here's my code...

>

> 1) Login.asp (input box):

> <INPUT id="Name" name="r_Name max" Length="30"   size="30" value=" <%

Request.Cookies("Name")%">



there is your code. but it should work now



----- Original Message -----

From: "Scott Vincent" <sdv@s...>

To: "ASP Web HowTo" <asp_web_howto@p...>

Sent: Friday, February 23, 2001 8:06 PM

Subject: [asp_web_howto] Cookies & blank spaces





> Hi All,

>

> In my .asp page I set the fields to write a cookie.

> When I close my browser and return to the page only information up to the

> first blank space shows.

>

> example:

> 1)Initial 'login' page... Name: Scott Vincent

> 2)Return to page reading from cookie: Name: Scott

>

> On my local machine the cookie value reads 'scott'. The space

> and 'vincent' were deleted.

>

> What can I do to have all the information in a field return with the

> spaces intact?

>

> Here's my code...

>

> 1) Login.asp (input box):

> <INPUT id=Name name=r_Name maxLength=30

>             size=30 value= <%= Request.Cookies("Name")%>

>

> << submit >> to return.asp where I have this statement >>

>

> 2) Return.asp:

> <%

> 'get value

> Name = Request.Form("r_Name")

> 'set session value

> Session("Name") = Name

> 'write cookie

> Response.Cookies("Name") = Name

>

> ... write this out for all other key/value pairs...

>

> ' Set path for cookies

> For Each cookie In Response.Cookies

> Response.Cookies(cookie).Path ="/"

> Response.Cookies(cookie).Expires = Date +365

> Next

> %>

>

>

> Thanks,

> Scott

>

  Return to Index