Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Session cookies in Asp.net
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Session cookies in Asp.net

 Post Reply Post Reply
Author
test49 View Drop Down
Newbie
Newbie


Joined: 08 September 2003
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote test49 Quote  Post ReplyReply Direct Link To This Post Topic: Session cookies in Asp.net
    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/>
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 19 January 2004 at 3:43pm

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

Gone..
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.