Click here to Skip to main content
15,914,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello friends,

I have following scenario.

I have one Login page and one My profile page.

In login page load event, I am checking that if user is authenticated then it redirects to my profile page. If user is not authenticated then user should have to login and then it redirects to my profile page.

now first time, user log in to the system then I am storing some values in session object and then it redirect to my profile page, in this case all sessions are getting filled up.

Now suppose, you type the URL in browser to access login page then it check authentication code in page load event and it redirects automatically to my profile page but in this case, all sessions are getting blank, before redirecting, I check session values and they all are exist at that time but after redirecting, its all blank in my profile page.

How could this happened if I am executing same function in both situation?

Thanks
Posted
Comments
Mahesh Bailwal 22-May-13 3:52am    
You mean to say in Session object keys are there with blank values?
Hemant Singh Rautela 22-May-13 4:06am    
your code..???

1.Check the session expiration time
2.Check all the operation of clear session.
 
Share this answer
 
I think you need such that,any unauthenticated user should not be able to access your profile page.Doing so,one should be redirected to login page.

For this,there is very good concept available called FORMS AUTHENTICATION.Refer to link below

How to: Implement Simple Forms Authentication[^]

If you use session,it will consume some memory at server side and you have to implement it in every page.

While using forms authentication,you just have to work with web.config file and you are done.

Let me know if you need more help on this.
 
Share this answer
 
v2

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