Question : Coookie not storing information

Hi experts,

I am trying to get a web application up and running which we usually use Apache for. I am trying it with IIS7 on Server 2008.  Basically we are using a mixture of PHP and JSP utilizing EAServer. I want to store the login, windows user and password and they are not coming up. Here is what the cookie looks like:
username|s:6:"nouser";password|s:4:"null";winuser|s:4:"null";

And here is my code:
Starting with welcome.php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
<?php 
$hostname = "MYHOST";
$hostname="BMSRV009";
if ($hostname=="BMSRV008")
{
echo "<script language=javascript>\n";
echo "document.location='./shared/timeout.htm';\n";
echo "</script>\n";
}
?>

<script language=javascript>
loc = location.href;
lsapp="app";
</script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 
<HTML>
<HEAD>
    <TITLE>TEST Login-Window</TITLE>
    <META http-equiv=Expires content=-1> 
    <META http-equiv=Content-Type content="text/html; charset=windows-1252">
</HEAD>
<BODY style="BACKGROUND-REPEAT: no-repeat" bgColor=white background="./bitmap/portal.jpg">
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>

<SCRIPT language=javascript>
function do_login()
{
if (loginform.password.value =='') {alert('No Password');return};
hours=24;
var expire = "";
if(hours != null)
{
expire = new Date('1/1/2009');
expire = "; expires=" + expire.toGMTString();
}
usrname = "usr";
usrvalue = loginform.username.value;
pwdname = "pwd";
pwdvalue = loginform.password.value ;


document.cookie = usrname + "=" + escape(usrvalue) + expire+";domain=xxx";
document.cookie = pwdname + "=" + escape(pwdvalue) + expire+";domain=xxx";



loginform.submit();
}
</SCRIPT>
<TABLE width="900"  id=TABLE1>
    <TBODY id=TBODY1>
    <TR id=TR1>
        <TD id=TD1 width=350></TD>
        <TD id=TD2 width=100>
        <FORM name=loginform action='../eheuron/maint/decrypt_test.jsp' method=get>                  <INPUT type="hidden" value="Heuron" name="app">
                <P align=right>
              </P>
        </TD>
        <TD id=TD3 width=80>
            <IMG id=IMG1 loop=infinite src="./bitmap/tornado.gif"> 
        </TD>
        <TD id=TD4 width=350>
 
            <BR id=BR2> 
 
        </TD>
    </TR>
    <TR id=TR2>
        <TD id=TD5></TD>
        <TD id=TD6>&nbsp;</TD>
        <TD id=TD7>&nbsp;</TD>
        <TD id=TD8>&nbsp;</TD>
    </TR>
    <TR id=TR3>
        <TD id=TD9></TD>
        <TD id=TD10>&nbsp;</TD>
        <TD id=TD11>&nbsp;</TD>
        <TD id=TD12>&nbsp;</TD>
    </TR>
    <TR id=TR4>
        <TD id=TD13></TD>
        <TD id=TD14>
            <H3>&nbsp;&nbsp;&nbsp;&nbsp; User Name</H3> 
        </TD>
        <TD id=TD15><H3>&nbsp;&nbsp; Password</H3></TD>
        <TD id=TD16>&nbsp; </TD>
    </TR>
    <TR>
        <TD></TD>
        <TD valign="top">
            &nbsp;&nbsp;&nbsp;&nbsp; 
            <INPUT id=username style="WIDTH: 112px; HEIGHT: 25px" size=1 onKeyPress="if ( window.event.keyCode==13) {do_login();} " value="" name=username>
        </TD>
        <TD>
            &nbsp;&nbsp; 
                        <INPUT id=password style="WIDTH: 112px; HEIGHT: 25px" type=password size=1 onKeyPress="if ( window.event.keyCode==13) {do_login();} " value="" name=password>

        </FORM>
<script language=javascript>
function readCookie(name)
{
  var cookieValue = "";
  var search = name + "=";
  if(document.cookie.length > 0)
  { 
    offset = document.cookie.indexOf(search);
    if (offset != -1)
    { 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}
username = readCookie("usr");
password = readCookie("pwd");

loginform.username.value=username;
loginform.password.value=password;
loginform.username.focus();

</script>
        </TD>
          <TD> 
         <IMG id=IMG2 style="CURSOR: hand" onClick="do_login();" src="./bitmap/login_button.bmp"> 
    </TD>
    </TR>
    </TBODY>
</TABLE>
</BODY>
</HTML>


decrypt_test.jsp:

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
<FORM name="loginform" action="http:\\xxxx\login_test.php" method="POST" >
<%@ page language="java" import="my_maint.*" %>
<% 
String username = request.getParameter("username");
String password = request.getParameter("password");
String app = request.getParameter("app");
String ret;
java.util.Properties props = new java.util.Properties();
props.put("org.omg.CORBA.ORBClass","com.sybase.CORBA.ORB");
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init((String[]) null, props);
n_adminmodule n_adminmodule = n_adminmoduleHelper.narrow (orb.string_to_object("my_maint/n_adminmodule"));
n_adminmodule.of_constructor(username,password);
ret = n_adminmodule.of_decryptuser(username,password);
n_adminmodule.of_deconstructor();

out.println("<INPUT id=username size=1 value='' name=username>");
out.println("<INPUT id=password size=1 value='"+password+"' name=password>");
out.println("<INPUT id=winuser size=1 value='"+username+"' name=winuser>");
out.println("<INPUT id=app size=1 value='"+app+"' name=app>");
out.println("</FORM>");

out.println("<SCRIPT language=javascript>");
out.println(ret);
out.println("loginform.username.value=username;");
out.println("loginform.submit();");
out.println("</SCRIPT>");

login_test.php
1:
2:
3:
Welcome <?php echo $_POST['username']; ?> <br />
Windows Login <?php echo $_POST['winuser']; ?> <br />
Password <?php echo $_POST['password']; ?> <br />


All are empty?  Thanks in advance for any help anyone can provide!

Answer : Coookie not storing information

What size are your shares/partitions on the Dell? I do recommend using RDMs for your VM storage as Arun suggests, although you don't have any real need to use RDMs except for the fact that it's just an easier transition (again, unless your storage is quite large...approaching 1TB for example). You can P2V your host, then just swap the SAN connection from your Dell to your ESX/i host, rescan your ESX/i HBAs, then (as Arun mentions), add a new hard disk to the VM as a RDM. You don't really gain performance having storage as a RDM on a VM as opposed to just creating a virtual disk, but again it's just an easier transition. Another benefit to using RDM is the P2V will take significantly less time. The more volumes you P2V, the longer the process takes to complete.

BTW...I have a DFS/fileserver that I P2V'd last summer and it works flawlessly. I have 5 volumes, 4 of which are network drives. All of them are RDMs, but I kept them that way because it was easier to virtualize the host (less time). 1 of my volumes is 1.5TB, so regardless, that one I would've kept as a RDM volume.

Hope that helps.

Regards,
~coolsport00
Random Solutions  
 
programming4us programming4us