Print Page | Close Window

Session cookies in Asp.net

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=8883
Printed Date: 29 March 2026 at 5:17am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Session cookies in Asp.net
Posted By: test49
Subject: Session cookies in Asp.net
Date Posted: 14 January 2004 at 5:16am
< name=sspkempty width=0 height=0>

Hi,

I was just wondering if anybody knows how to set the expiration hour for session cookies?

Like I want it to expire, let's say 9pm? I don't mind about the timezone problems that can occour, because 95% of my users are within the same timezone.

I've been discussing this on other forums as well, and they say it's impossible because you'll have to modify the web.config file to do this. And they say that that's impossible through asp.net without doing it manually.

Anyone have any suggestions on this issue? Would love to hear your comments!

Regards
Kriss

< = =text/>



Replies:
Posted By: Mart
Date Posted: 14 January 2004 at 11:47am
What do you mean it's impossible because you will have to edit the web.config file... I edit that file regually


Posted By: MorningZ
Date Posted: 14 January 2004 at 12:20pm

"And they say that that's impossible through asp.net without doing it manually."

thats bogus... you can access Web.config through code by loading the XML file into memory and using Xpath to find (and edit) the node needed



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: MorningZ
Date Posted: 14 January 2004 at 12:21pm

and to help with your 9 pm "problem"

why don't you just do a "DateDiff" between "Now() and "9pm" and set a cookie that expires how ever many minutes are between the two

having session objects hanging around in server memory for no reason is just asking for server issues



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: Diep-Vriezer
Date Posted: 19 January 2004 at 3:43pm

HttpContext.Current.Session.Timeout() = DateDiff? So this shouldn't work right?



-------------
Gone..



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net