Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a problem regarding next URL address.
Problem:
I copy a url of my website like "Home/Photo.aspx?Id=1"; Id contains session id of user.
after copying the url i get logged out.

Now when i try paste this url in the address bar the website page sends me to the login page as the session is null, and when i get login i get redirected to the home page.

But i wanted to go in the photo.aspx or any another page url i have copied previously not the home.aspx page which comes after login page how is this possible?
Posted
Updated 16-Apr-11 4:22am
v2
Comments
Albin Abel 16-Apr-11 11:24am    
Clear the cookies when logout.

But i wanted to go in the photo.aspx or any another page url i have copied previously not the home.aspx page which comes after login page how is this possible?
1. Sounds like you are not using Form's authentication. In case you use that, it would take care of this automatically.
2. Now, the options are to use one of the state management techniques. Use session to keep track of the requested URL for the first time. Once you are logged in, check if any url is there in that session, if so then use it and direct the page there.

Try!
 
Share this answer
 
Comments
naveen.0nick 17-Apr-11 7:33am    
it's working with the help of session now but what is this form authenticastion can u explain in brief.
Sandeep Mewara 17-Apr-11 9:28am    
1. If it is done, close the question by accepting answer.
2. For forms authentication, just Google "Forms Authentication". Thousands of links are there.
for logout
use formauthentication logout method like

Formauthentication.RedirectToLoginPage();

It will take care what u need.
 
Share this answer
 

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