Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. how can expire previous page

how can expire previous page

Scheduled Pinned Locked Moved Web Development
htmloraclesysadmin
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    idsanjeevjha
    wrote on last edited by
    #1

    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

    C M 2 Replies Last reply
    0
    • I idsanjeevjha

      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

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      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 )

      1 Reply Last reply
      0
      • I idsanjeevjha

        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

        M Offline
        M Offline
        Michael Sync
        wrote on last edited by
        #3

        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 1 Reply Last reply
        0
        • M Michael Sync

          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 Offline
          I Offline
          idsanjeevjha
          wrote on last edited by
          #4

          i am not using asp.net not any solution in asp with vbscript

          sanjeev

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups