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. ASP.NET
  4. Session problem

Session problem

Scheduled Pinned Locked Moved ASP.NET
helpquestion
5 Posts 5 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.
  • A Offline
    A Offline
    Affan Toor
    wrote on last edited by
    #1

    Hi! Hope every one is fine, i am facing a problem in session management. I created a session and used it to store the login id and type of user. session goes fine and terminates when user logouts but after user logouts from site and then presses "BackSpace" button it redirects to the last page opened, but no action could be performed on that page. it should not happen because only authenticated users are allowed to view any page other than login page. Can any body tell me how can i restrict any page of my site to be opened like this? i am new to web development so any kind of help is appriciated. Thanks, Regards, Affan Ahmad Toor

    .................. QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!

    C N D P 4 Replies Last reply
    0
    • A Affan Toor

      Hi! Hope every one is fine, i am facing a problem in session management. I created a session and used it to store the login id and type of user. session goes fine and terminates when user logouts but after user logouts from site and then presses "BackSpace" button it redirects to the last page opened, but no action could be performed on that page. it should not happen because only authenticated users are allowed to view any page other than login page. Can any body tell me how can i restrict any page of my site to be opened like this? i am new to web development so any kind of help is appriciated. Thanks, Regards, Affan Ahmad Toor

      .................. QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      Affan Toor wrote:

      then presses "BackSpace" button it redirects to the last page opened, but no action could be performed on that page

      You are seeing the cached version of page by browser. You can disable caching for pages and that could solve your problem.


      My Website | Ask smart questions

      1 Reply Last reply
      0
      • A Affan Toor

        Hi! Hope every one is fine, i am facing a problem in session management. I created a session and used it to store the login id and type of user. session goes fine and terminates when user logouts but after user logouts from site and then presses "BackSpace" button it redirects to the last page opened, but no action could be performed on that page. it should not happen because only authenticated users are allowed to view any page other than login page. Can any body tell me how can i restrict any page of my site to be opened like this? i am new to web development so any kind of help is appriciated. Thanks, Regards, Affan Ahmad Toor

        .................. QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!

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

        Basically, all your pages should derive from a base page which checks if the user is logged in, and, if not, redirects to the login page.

        Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        1 Reply Last reply
        0
        • A Affan Toor

          Hi! Hope every one is fine, i am facing a problem in session management. I created a session and used it to store the login id and type of user. session goes fine and terminates when user logouts but after user logouts from site and then presses "BackSpace" button it redirects to the last page opened, but no action could be performed on that page. it should not happen because only authenticated users are allowed to view any page other than login page. Can any body tell me how can i restrict any page of my site to be opened like this? i am new to web development so any kind of help is appriciated. Thanks, Regards, Affan Ahmad Toor

          .................. QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!

          D Offline
          D Offline
          darkcalin
          wrote on last edited by
          #4

          try this: on login page: protected void Page_Load(object sender, EventArgs e) { ......... //if the user is valid Session.Add("user", user); ....... } on other page protected void Page_Load(object sender, EventArgs e) { ....... if (Session["user"]==null) Response.Redirect("login.aspx"); ........ } on logout Session.Remove("user"); I hope that will help you.

          1 Reply Last reply
          0
          • A Affan Toor

            Hi! Hope every one is fine, i am facing a problem in session management. I created a session and used it to store the login id and type of user. session goes fine and terminates when user logouts but after user logouts from site and then presses "BackSpace" button it redirects to the last page opened, but no action could be performed on that page. it should not happen because only authenticated users are allowed to view any page other than login page. Can any body tell me how can i restrict any page of my site to be opened like this? i am new to web development so any kind of help is appriciated. Thanks, Regards, Affan Ahmad Toor

            .................. QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!

            P Offline
            P Offline
            Piyush Vardhan Singh
            wrote on last edited by
            #5

            clear the session on log out

            Piyush Vardhan Singh Programmer TAS NewDelhi India

            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