Ciao a tutti, vorrei sapere come fare per aggiungere alla sessione che già viene creata in fase di login un ulteriore sessione,
cerco di spiegarmi meglio:
Con questo codice:
creo in fase di login la sessione username, che verrà controllata in ogni pagina per verificarne la presenza, ma vorrei che venga creata anche la sessione di e-mail dell'utente stesso, per fare in modo che il dato sia sempre presente e reperibile, per essere stampato a video come avviene per l'username...codice:<%@LANGUAGE = JScript%> <% var azione = new String(Request.QueryString("azione")); %> <html> <head> <title>Login</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head> <style type="text/css"> body { margin: 0px, 0px, 0px, 0px; } div, td, input, textarea { font-size: 10px; font-family: Times; } a { color: #0000FF; text-decoration: None; } a:hover { color: #FF0000; text-decoration: Underline; } </style> <body scroll="Yes" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <% if (azione == "OK") { var username = new String(Request.Form("username")); var password = new String(Request.Form("password")); var username2 = username.replace(/'/g,"''"); var password2 = password.replace(/'/g,"''"); Cn = new ActiveXObject("ADODB.Connection"); Cn.Open("driver={Microsoft Access Driver (*.mdb)};dbq=" + Server.MapPath("../../../../mdb-database/utenti.mdb")); var Sql = "SELECT * FROM tbl_authors WHERE name = '" + username2 + "' AND pass = '" + password2 + "'"; var EseguiLogin = Cn.Execute(Sql); if (EseguiLogin.EOF) { Cn.Close(); Response.redirect("accesso_negato.asp"); Response.End; } else { Cn.Close(); Session("username") = username; with (Response) { Response.redirect("../"); } } } else { %> <div align="center"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="500" height="60"> <param name="movie" value="../testata_forum.swf"> <param name="quality" value="high"> <embed src="../testata_forum.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="500" height="60"></embed></object> </div> <form method="post" action="login.asp?azione=OK"> <div align="center"> <table width="286" height="98" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="106"><div align="right"><font color="#0000CC">Username</font> </div></td> <td width="180"><input name="username" type="text" size="30"></td> </tr> <tr> <td><div align="right"><font color="#0000CC">Password</font> </div></td> <td><input name="password" type="password" size="30"></td> </tr> <tr> <td height="39"></td> <td> <input name="submit" type="submit" value="Login"> <input type="reset" name="Submit" value="Cancella"> </td> </tr> </table> </div> </form> <% } %> <div align="center"> <font size="2">Non ti ricordi la Password? <a href="../../../../recupera_password_forum.asp">Clicca qui</a> Se Non sei Registrato <a href="../../../../registrazione_forum.asp">Clicca qui</a></font></p> </div> </body> </html>
Come posso fare?
io controllo la sessione con il codice:
come posso fare?codice:<script language="VBScript" runat="server"> if Session("username") = "" or isNull(Session("username")) then response.redirect "login/login.asp" 'response.write "Non c'è la sessione" else end if </script>
Grazie a tutti ciao

Rispondi quotando