Click here to Skip to main content
15,886,083 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hii

i am making a web application in which i amke seesion of id but it did not prevent to open same page using copy or paste the url in new window or tab. how it is possible plz any one tell me

thank you in advance
Posted
Updated 5-Nov-17 19:05pm
Comments
I.explore.code 23-Apr-13 4:47am    
Can you please improve your question a bit? if you are using session for authentication and opening the authenticated page in a different tab of the same browser, then this is the expected behavior as the session cookie still exists on the computer for that browser and is valid. Try using a different browser to open the copy and pasted url and see if that opens up.
supriya931 23-Apr-13 5:10am    
no there is no authenicated page i am just using a trans id to count transaction through that page and i amke the seesion of trans id till the last page but it open when i copy the url of that page and inserted the valuein database from the copy url page
I.explore.code 23-Apr-13 5:46am    
can you explain what exactly you are trying to achieve (perhaps add some code to your question)? may be using session for that isn't such a good idea?

1 solution

Create a page named it "ErrorPage.aspx" and give message in page.
Now, in your current page Use below code:

C#
protected void Page_Load(object sender, EventArgs e)
   {
       if (!IsPostBack)
       {
           if (Session["TransIDId"] == null)
           {
               Response.Redirect("ErrorPage.aspx");
           }
       }
   }
 
Share this answer
 
Comments
supriya931 23-Apr-13 6:40am    
i am want that no one can open a same page by copy the url of that page simple ho w it is possible
supriya931 23-Apr-13 6:42am    
sorry sant osha it is not working
Sant Osha 23-Apr-13 6:43am    
its not possible... because code doesn't understand in which tab or window its working

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900