think you use seesion variable in your appliaction hence when you click on back page loged in again same problem there is in yahoo
as per me use coockies and expire it on click of logout dangerours but simple way according to me
you can solve this problem using state managment or database.
When you login store your username in cokkies and when you logout that time cler your cokkies. and on page postback check whether the Cokkies have username. If cookies dose not have any username then redirect User to login page or MasterHOme page.
or otherwise create a column like avil in database when you login that time make that column for that user true and when you logout make that column for that user False when he back then on post page chak wheter that column for that user is True. if false then redirct user to As per i told you.
but the better is use State Manegment.:) it qite simple and database like landdy.:p
try both method is working on my computer.:)
Please post your login/logout code here (minus any password sensitive information if present in your code) so that we can see the process you're using to maintain your login session.
Depending on your session management method we may be better able to suggest the best possible method for ending the session so that if someone uses the "back" button the expired session means that they would be forced to log in again.
Best way to do it Store user details in session when login and with logout clear session data, On every page load event check user credential then only proceed else redirect it to login page.....:icon_idea:
dear mono_jit23 your post will not work becouse whene u click BACK button of browser it fetch page from browser cache not go to server so for this time your application willnot able to check creadantioal k for that u have to prevent page cach by browser refer my last post in this thread
your application willnot able to check creadantioal
This is dependant on browser as well as postback properties of the pages. Even if the browser is pulling the page content from it's cache, if the page code requires a check of credentials at page_load it should still technically be performing this check whether it's cached or live.
write this to all your master pages and on the form load event of forms which are not derived from any master form
reason why this happen:-
whene u click BACK button of browser it fetch page from browser cache not go to server so for this time your application willnot able to check creadantioal k for that u have to prevent page cach by browser
create procedure getsearchresult
@firstname varchar(50)='',@lastname varchar(50)='',@midname varchar(50)=''
select * from tablename(if require use joints)
( @firstname='' or colname like'%'+@firstname+'%') and
( @lastname='' or colname like'%'+@lastname+'%') and
( @midname='' or colname like'%'+@midname+'%')
use this query for your search button edit according to youe table and col name and if you working with vb.net then replace + with & try it if u have to search based on 3 parameters and you passed only 2 parameters and leave one blank then it will give you result on passed 2 parameteres
i've a problem here where when i logout i still can click back..can anyone solve my problem?
You can use this logic in master page page_Load event
Private Sub IsUserAuthenticated()
If Me.Context.User.Identity.IsAuthenticated = False Then
When the user press browsers back button and try to perform any action, the master page load event will fire and checks if the user is isauthenticated i.e logged-in, if not then it will redirect to the login page. This logic works with me.