locked
How to reuse session. RRS feed

  • Question

  • User637234440 posted

    I am using asp.net membership in my application and I have to reuse the session already created for that logged in user.

    Means if an user logged into the application and open same application in new tab then user should be logged in autometically without re-enter user credentials.

    Wednesday, December 12, 2012 11:49 PM

Answers

  • User-151368862 posted

    So it means you must first store user logged in status inside session
    So do it write after successful login, store user name and (possibly) user type in session, then
    on Page_Loag event of every page in your application you must write something like:

    if( Session["varUserName"].ToString() == null)
    {
    // redirect to Login page
    }
    else
    {
    // Welcome user by first checking user name and use type
    }



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 13, 2012 12:32 AM