Click here to Skip to main content
15,993,805 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to keep the sesion alive when user is in stable state like ecommerce website is using that in add cart and customer login session reply me urgent
Posted
Comments
Ankur\m/ 27-Jun-13 2:43am    
Your question is not clear. how long do you want the session to be alive? You can always configure SessionTimeout. But is it only the login that you are concerned with?

You can use HiddenField to store session.....:)

Regards,

Nirav Prabtani...:)
 
Share this answer
 
Comments
Ankur\m/ 27-Jun-13 2:44am    
WHAT ??? AND HOW?
Nirav Prabtani 27-Jun-13 2:51am    
You have one control named HiddenField in Standerd Control

<asp:HiddenField ID="HiddenField1" runat="server" />

you can store session value at codebehind in hiddenfield like that....

HiddenField1.Value=Session["Name"];

now your session has been stored into hiddenfield.....:)

for more information...

http://www.devmanuals.com/tutorials/ms/aspdotnet/hiddenfield.html

Ankur\m/ 27-Jun-13 3:15am    
Suppose I have a dataset in the session containing the the user details. How do I set it in hidden field.
And how does that answer the question - hidden field exists on ONE page and not all of them. So once I navigate to other page, the value is gone. How do I keep my user logged in?
Nirav Prabtani 27-Jun-13 3:21am    
yes you are right
hiddenfield is useful for one page only..
id you want to keep user logged in then there is session variable already for that....
you can store the value in cookies.. or database
 
Share this answer
 
Comments
Ankur\m/ 27-Jun-13 2:47am    
I think your answer is somewhat correct. But it's too short for a solution. I mean it doesn't explain how. Someone has down-voted it. You will have my counter up-vote if you improve your 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