Click here to Skip to main content
15,892,161 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear All

How to redirect the un registered user to the login page. If he attempt to directly write the Url of secured page in the address bar?




Regards
Posted

1 solution

You can check the http referrer to see if it's empty, but you can spoof that. You could store something in the session on your front page, then check for that value so if someone goes direct to your restricted site as the first page then the session variable will be empty.
 
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