C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




sessions


Posted Date: 05 Sep 2008      Total Responses: 3

Posted By: Musturu Thippa Reddy       Member Level: Silver     Points: 1



hi to all


i developed login page but i need expire time option.it means after 10 min of login ask the user name and passwords once again and goes to login page
for this i wrote< sesstionstate timeout="1"/>
in web config file.
i was not not call any . i need to call any where? plzzzzz explain i am new to sessions?





Responses

Author: Gaurav Agrawal    05 Sep 2008Member Level: DiamondRating:     Points: 3

Hi
On all pages at pageload() event call a simple function that checks that session is exits or not and if not exist then redirect to login page else doing ur work.

public check()
{
if(session["userid"]==null)
response.redirect("login.aspx");
}

simple function to check the session
Thanks
GA



Author: mythili d    05 Sep 2008Member Level: SilverRating:     Points: 3

<authentication mode="Forms">
<forms timeout="10" slidingExpiration="true" name="your application name"></forms>
</authentication>
this will automatically log you out of the website and puts you on the unauthenticated page whihc is your login page.
thanks



Author: Vivek Sharma    06 Sep 2008Member Level: GoldRating:     Points: 3

Hi, by default session timeout duration is 20 minuts
we can increase the timeout value by changing in web config
file up to one year.

<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
cookieless="false"
timeout="10"
after expiration the session duration if you can redirect
the user on login page againby using this code on page load

if(session["uid"]==null)
Server.Transfer("Login.aspx");




Post Reply
You must Sign In to post a response.
Next : how to ristrict the image size to height=400 and size=600
Previous : Automatic Sending Mails 2 clients
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use