how can expire previous page
-
i wants to if user is logout and then don't allow to go back with standard button i am using for logout but it don't control on back button of standard button [code] <%@ Language=VBScript %> <% Option Explicit %> <html> <head> <title>Voice Of Baraunians</title> <!--#include file="front.inc"--> </head> <body "> <%If Request.Cookies("empno") = "" Then%> <div style="Position:Absolute; top:150; left:250;background-color: #f0f0f0"> <center><h2><font face="arial" color='blue'>You are not authorised to view this page. You will be prosecuted for this action</font></h2></center> </div> <%Else%> <div style="Position:Absolute; top:150; left:100"> <h2>Logging Out ............</h2> <h4>Wait a moment.</h4> </div> <% Dim conn Dim R Dim vempno Set conn = Server.CreateObject("ADODB.Connection") conn.Mode = adModeReadWrite conn.Open("DSN=Oracle; USER ID = gatepass; PASSWORD = gp") Set R = Server.CreateObject("ADODB.Recordset") R.Open "Select empno from emp_authority", conn, adOpenStatic, adLockOptimistic, adCmdText vempno = Request.Cookies("empno") R.Find "empno = " & vempno & "" Response.Cookies("empno") = "" R.Close Set R = Nothing conn.close Set Conn = Nothing Response.Redirect "message3.asp" End If %> </body> </html>
sanjeev
-
i wants to if user is logout and then don't allow to go back with standard button i am using for logout but it don't control on back button of standard button [code] <%@ Language=VBScript %> <% Option Explicit %> <html> <head> <title>Voice Of Baraunians</title> <!--#include file="front.inc"--> </head> <body "> <%If Request.Cookies("empno") = "" Then%> <div style="Position:Absolute; top:150; left:250;background-color: #f0f0f0"> <center><h2><font face="arial" color='blue'>You are not authorised to view this page. You will be prosecuted for this action</font></h2></center> </div> <%Else%> <div style="Position:Absolute; top:150; left:100"> <h2>Logging Out ............</h2> <h4>Wait a moment.</h4> </div> <% Dim conn Dim R Dim vempno Set conn = Server.CreateObject("ADODB.Connection") conn.Mode = adModeReadWrite conn.Open("DSN=Oracle; USER ID = gatepass; PASSWORD = gp") Set R = Server.CreateObject("ADODB.Recordset") R.Open "Select empno from emp_authority", conn, adOpenStatic, adLockOptimistic, adCmdText vempno = Request.Cookies("empno") R.Find "empno = " & vempno & "" Response.Cookies("empno") = "" R.Close Set R = Nothing conn.close Set Conn = Nothing Response.Redirect "message3.asp" End If %> </body> </html>
sanjeev
Using cookies to control who is logged in, is insane. Users can edit cookies. Use the Session to store this, and your pages will log out correctly, even if they hit the back button. Wow - you're using classic ASP ? What a nightmare.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
i wants to if user is logout and then don't allow to go back with standard button i am using for logout but it don't control on back button of standard button [code] <%@ Language=VBScript %> <% Option Explicit %> <html> <head> <title>Voice Of Baraunians</title> <!--#include file="front.inc"--> </head> <body "> <%If Request.Cookies("empno") = "" Then%> <div style="Position:Absolute; top:150; left:250;background-color: #f0f0f0"> <center><h2><font face="arial" color='blue'>You are not authorised to view this page. You will be prosecuted for this action</font></h2></center> </div> <%Else%> <div style="Position:Absolute; top:150; left:100"> <h2>Logging Out ............</h2> <h4>Wait a moment.</h4> </div> <% Dim conn Dim R Dim vempno Set conn = Server.CreateObject("ADODB.Connection") conn.Mode = adModeReadWrite conn.Open("DSN=Oracle; USER ID = gatepass; PASSWORD = gp") Set R = Server.CreateObject("ADODB.Recordset") R.Open "Select empno from emp_authority", conn, adOpenStatic, adLockOptimistic, adCmdText vempno = Request.Cookies("empno") R.Find "empno = " & vempno & "" Response.Cookies("empno") = "" R.Close Set R = Nothing conn.close Set Conn = Nothing Response.Redirect "message3.asp" End If %> </body> </html>
sanjeev
ASP.NET 1: Response.ExpiresAbsolute = DateTime.Now.AddDays(-1) Response.CacheControl = "no-cache"; Response.Expires = -500; ASP.NET 2: Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetExpires(DateTime.Now.AddDays(-1)); //or a date much earlier than current time Ref: http://www.codeproject.com/script/Forums/View.aspx?fid=12076&msg=2324415[^]
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
-
ASP.NET 1: Response.ExpiresAbsolute = DateTime.Now.AddDays(-1) Response.CacheControl = "no-cache"; Response.Expires = -500; ASP.NET 2: Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetExpires(DateTime.Now.AddDays(-1)); //or a date much earlier than current time Ref: http://www.codeproject.com/script/Forums/View.aspx?fid=12076&msg=2324415[^]
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
i am not using asp.net not any solution in asp with vbscript
sanjeev