Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all.,

Iam using Visual Studio 2012 and Windows 8 for development. When iam moving my code to iis Global.asax methods are not firing. In Session_Start method of global.asax I redirect my request to Login page. When I change and copy my url from address bar and paste it on new browser window for the first time it redirects to Login page but later it open the actual page reffered in address url.
Can anyone give me any suggestions to redirect my page to Login page in production server.
Posted

1 solution

The Session_Start event fires only the first time you visit the website, because the first time you visit the website a new Session is started.

If you want an event to fire on each request you can use the Application_BeginRequest or the Application_AuthenticateRequest events.

P.S. If you are trying to implement a login mechanism, you could use the built-in authentication mechanism of ASP.NET.
 
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