Read IP address from Cookie

Ø

Øyvind Isaksen

Hello!

Have a site that contains both ASP (3.0) and ASP.NET files.
When I log inn, my login.asp write info to a cookie to use for
authentication in my asp.net files. One of the things I write to the cookie
is the users local IP address. My problem comes when I try to "use" this IP
address in my asp.net files. When I print out the IP adress from the cookie,
it looks like theis:

127%2E0%2E0%2E1

It has to be in a format like this: 127.0.0.1

How can this be done correct??


---------------------------------------------------------------
This is how I read from the cookie in my asp.net file:

Dim ip As String = Request.Cookies("login")("ip")
Response.Write(ip & "<br>")

OUTPUT: 127%2E0%2E0%2E1
 
S

S. Justin Gengo

Oyvind,

You'll want to utilize:

Server.HtmlEncrypt

and

Server.HtmlDecrypt

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
G

Guest

It's URLEncoded (or is that HTMLEncoded?)
Look for the corresponding Decode method, or just do a .Replace()
 
J

Juan T. Llibre

That should be :

Server.URLEncode
and
Server.URLDecode

See the sample at : http://asp.net.do/test/URLDecode.aspx




Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
S. Justin Gengo said:
Oyvind,

You'll want to utilize:

Server.HtmlEncrypt

and

Server.HtmlDecrypt

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
S

S. Justin Gengo

Oops,

Thanks for the correction Juan. I've pulled that out of memory, knew it was
one of the two, and remembered it wrong...

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
Juan T. Llibre said:
That should be :

Server.URLEncode
and
Server.URLDecode

See the sample at : http://asp.net.do/test/URLDecode.aspx




Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top