Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

asp/cookie not work with Netscape

Posted on 1999-09-09
12
Medium Priority
?
258 Views
Last Modified: 2013-12-25
I have an asp to create new cookie and it works fine with IExplorer but not work with Netscape. What code I need for Nestcape?

The actual code is:
<%
l=request.form("username")

f=request.form("userpassword")

k=request.form("C1")

If k="ON" then
cookypath="/"
cookydomain=".www.stock-research.net"
cookydie=date+1095
Response.Cookies("thatperson")("name") = l
Response.Cookies("thatperson")("password") = f
Response.Cookies("thatperson")("state") = st
Response.Cookies("thatperson").Expires = cookydie
Response.Cookies("thatperson").Domain = cookydomain
Response.Cookies("thatperson").Path = cookypath
end if
%>

Thanks,
0
Comment
Question by:boc7900
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 2
  • 2
  • +1
12 Comments
 

Author Comment

by:boc7900
ID: 2033175
Adjusted points to 200
0
 
LVL 3

Expert Comment

by:anuravi
ID: 2033359
The code looks pretty good. I have similar code working on my machines. What kind of Error if any are you getting.
Ravi
0
 

Author Comment

by:boc7900
ID: 2033609
Netscape do not write a client cookie and then do not read it. If there are a cookie writed from I.Explorer, Netscape not read it either.
0
Plesk WordPress Toolkit

Plesk's WordPress Toolkit allows server administrators, resellers and customers to manage their WordPress instances, enabling a variety of development workflows for WordPress admins of all skill levels, from beginners to pros.

See why 2/3 of Plesk servers use it.

 

Expert Comment

by:heaveyrl
ID: 2033647
You don't state versions of IE or Netscape.

Check that the security settings and drop the cache.

Publish what the error message are and when they occur.

0
 

Author Comment

by:boc7900
ID: 2033785
There arent any error message. The asp page, after login, write a cookie for save user ID and password for next sessions, and write a session ID to access security protected pages. I tried it with IE 5.0 and Netscape 4.5. IE works fine. Netscape not send any error message because the session ID works fine, but at next session requires login user id and password. IE wrote a cookie to \windows\cookies and windows\temp..internet..files but I don't found nothing after login with Netscape.
0
 
LVL 3

Expert Comment

by:anuravi
ID: 2033904
I think the .Expires value should be of some particualr format.
Check that...
Response.Cookies("VisitorID").Expires = "December 31, 2001"
0
 

Author Comment

by:boc7900
ID: 2035950
I tried all data formats and it doesn't work. The problem (I thing) is that Netscape do not write the cookie at ...\Netscape\Users\Default\Cookies.txt file.
0
 

Author Comment

by:boc7900
ID: 2041713
The answer do not solve the problem.
0
 
LVL 11

Expert Comment

by:mouatts
ID: 2042967
Firstly the cookie isn't written to the file until all instances of the browser have closed down.

Secondly make sure that default is the correct user.

Thirdly could you post the html that calls the asp page.

Steve
0
 

Author Comment

by:boc7900
ID: 2044367
PAGE 1
<html>

<head>
<title>securitylogin.asp</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
</head>

<body bgcolor="#FFFFFF" background="../images/fondo.jpg" leftmargin="40" topmargin="20">

<form action="securityloginrespond.asp" method="POST">
  <p>Introduzca sus claves:</p>
  <table border="1" width="60%">
    <tr>
      <td>Identificador de usuario: </td>
      <td>&nbsp;<input NAME="userName" size="20"></td>
    </tr>
    <tr>
      <td>Password:
      &nbsp;</td>
      <td>&nbsp;<input type="password" name="userPassword" size="20"></td>
    </tr>
  </table>
  <p>Guardar claves para acceder en ocasiones posteriores:&nbsp; <input type="checkbox"
  name="C1" value="OFF"><br>
  </p>
  <p>
  <input type="submit"> </p>
</form>
</body>
</html>

PAGE 2

<%response.buffer=true%>
<%
l=request.form("username")

f=request.form("userpassword")

k=request.form("C1")

If k="OFF" then
cookypath="/"
cookydomain=".www.stock-research.net"
cookydie=date+1095    
Response.Cookies("thatperson")("name") = l
Response.Cookies("thatperson")("password") = f
Response.Cookies("thatperson")("state") = st
Response.Cookies("thatperson").Expires = cookydie
Response.Cookies("thatperson").Domain = cookydomain
Response.Cookies("thatperson").Path = cookypath
end if
%>
<html>

<head>
<title>securityloginrespond.asp</title>
</head>

<body bgcolor="#FFFFFF" background="../images/fondo.jpg">
<%
dbname="/_private/users.mdb"
myname=request.form("username")
mypassword=request.form("userpassword")
set conntemp=server.createobject("adodb.connection")
cnpath="DBQ=" & server.mappath(dbname)
conntemp.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & cnpath
sqltemp="select * from users where user='"
sqltemp=sqltemp & myname & "'"
set rstemp=conntemp.execute(SQLTemp)
If rstemp.eof then%>

<p>Nombre de usuario incorrecto:&nbsp; <%=Myname%> <br>
<a href="securitylogin.asp">Introduzca de nuevo sus claves</a>&nbsp; <%response.end
end if
If rstemp("Password")=mypassword then
session("name")=rstemp("user")
session("securitylevel")=rstemp("securitylevel")
response.write "Autorización correcta. Pulse <a href='/stocknet/default.asp'>Menú principal</a> " & session("securitylevel")
else%> <br>
Password icorrecto:<br>
<a href="securitylogin.asp">Introduzca de nuevo sus claves</a>&nbsp; <%response.end
end if
rstemp.close
conntemp.close
set rstemp=nothing
set conntemp=nothing
%> </p>
</body>
</html>
0
 
LVL 11

Accepted Solution

by:
mouatts earned 800 total points
ID: 2047615
The problem is that the domain is invalid.

Firstly you can only set the domain to be the one that the cookie is set from or a partial that matches the host.

So for the script to work it must be operating from
something.www.stock-research.net

If you are working from www.stock-research.net then all you need to do is to remove the leading dot.

Otherwise you need to put the correct domain in. To retain portability across servers try replacing you line with the following

cookydomain=request.servervariables("HTTP_HOST")

In case you ask why you are not allowed to do this the answer to that is that it is a security hobble to prevent cookies being passed to domains other than the one upon which they where set thus keeping the data private.

Steve
0
 

Author Comment

by:boc7900
ID: 2047662
Thanks!. It works fine.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question