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

I have the following situation:
The user logs in the website, navigates through certain pages and data is saved in every page in the session. There are 6 pages and data in the previous page is the source for data in the next page.
However in a scenario where the login times out, the session will also be cleared. Then the user will be asked to login again.
Suppose the user is in the 5th or 6th page. So if he is redirected to that page the data source for the page will be null and hence it will throw an error.
Is there any way of managing that?
One approach is navigating the user to the 1st page. But apart from this, is there any other solution?
Posted

1 solution

I think the best way to redirect the user to login page can be better handled by forms authentication. Refer to this link.

How to: Implement Simple Forms Authentication[^]

Here,if the user tries to open some page and if its not allowed,then she will be asked to provide credentials. Once provided the same,she will be landed to the page she was trying to access.

Using session have some disadvantages e.g. It will be stored on server,so its bad idea.

Regards..:laugh:
 
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