Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


How to stop anyone to open a login page url in other browser in asp.net?


How to stop anyone to open a login page url in other browser in...

Author
Message
johndevid0987
johndevid0987
Forum God
Forum God (1.1K reputation)Forum God (1.1K reputation)Forum God (1.1K reputation)Forum God (1.1K reputation)Forum God (1.1K reputation)Forum God (1.1K reputation)Forum God (1.1K reputation)Forum God (1.1K reputation)Forum God (1.1K reputation)

Group: Forum Members
Posts: 3, Visits: 1
i have created a login page in asp.net using c# and when i open that page after validation then the url address is opened in a new browser even after i close that window by clicking sign out button. that page can be opened by just copying that url address even after i sign out.



how to stop it? serious answer please.

disney dvds

, los angeles seo
TallOne
TallOne
Forum God
Forum God (49K reputation)Forum God (49K reputation)Forum God (49K reputation)Forum God (49K reputation)Forum God (49K reputation)Forum God (49K reputation)Forum God (49K reputation)Forum God (49K reputation)Forum God (49K reputation)

Group: Forum Members
Posts: 370, Visits: 212
You need to create a Session or ViewState variable to determine if the user is logged in or has a valid userID.  You can replace Session("UserID") with ViewState but ViewState scope is limited to the life of the page, session("") is limited to life of the sign in assuming after sign out you clear the session.

You could call it something like Session("UserID") = xUSERID

In the page load of each page after login you write something like this:

{
    if (Session("UserID") != null && Session("UserID") > 0) {
    }
    //load your variables do your stuff
    else {
    }
    //Redirect to login page
}

Good Luck

TallOne

123
123
Forum God
Forum God (423 reputation)Forum God (423 reputation)Forum God (423 reputation)Forum God (423 reputation)Forum God (423 reputation)Forum God (423 reputation)Forum God (423 reputation)Forum God (423 reputation)Forum God (423 reputation)

Group: Forum Members
Posts: 1, Visits: 2
Hi... I am using ASP.NET 2.0  (coding thru VB) with SQL SERVER 2000. I have used the  given code, but still d same problem occurs & Session is not getting over.I've also  used Session.Abandon() on the logout button,bt not working,I want 2 disable the navigation buttons,wen i log out the page.... Plz reply asap....
TallOne
TallOne
Forum God
Forum God (49K reputation)Forum God (49K reputation)Forum God (49K reputation)Forum God (49K reputation)Forum God (49K reputation)Forum God (49K reputation)Forum God (49K reputation)Forum God (49K reputation)Forum God (49K reputation)

Group: Forum Members
Posts: 370, Visits: 212
Is this new window in the same domain? 

Why not redirect? 

How are you opening the new window?  You may need to pass query string params to the new window and evaluate.

Post your code and I'll take a look.

TallOne

ramee001
ramee001
Forum God
Forum God (405 reputation)Forum God (405 reputation)Forum God (405 reputation)Forum God (405 reputation)Forum God (405 reputation)Forum God (405 reputation)Forum God (405 reputation)Forum God (405 reputation)Forum God (405 reputation)

Group: Forum Members
Posts: 1, Visits: 6
Read up on sessions.



Your 'signout' button is not killing your users session so when you reenter the url the browser is reading the active session and believes the users is still vaild.



if your are using the asp.net login controls make sure that you have it setup correctly

Refrigerator Filters Humidifier Filters
sprite44
sprite44
Forum God
Forum God (397 reputation)Forum God (397 reputation)Forum God (397 reputation)Forum God (397 reputation)Forum God (397 reputation)Forum God (397 reputation)Forum God (397 reputation)Forum God (397 reputation)Forum God (397 reputation)

Group: Forum Members
Posts: 1, Visits: 4
I was having the same problem, but I just put in the code that TallOne suggested and it works great. It is simply a matter of having the page redirected to the login page. The sign out button will work just fine when using the redirect. However, I am having another problem, when I sign out and click the back button, it brings everything back up. I found a code that works great on IE8, but doesnt work on Mozilla. Does anyone have a code to prevent browser back button click after sign out? for Mozilla that is? Appreciate the help in advance, thanks.

RO Water Systems
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search