Author Topic: Cookies  (Read 1288 times)

  • Offline FuMaN

  • Posts: 250
  • Sr. Member
Cookies
on: June 17, 2006, 15:29:50 PM
Im currently developing in VB.NET and have been using Sessions but want to change to cookies. However I have no experience of using this, is it just going to be similar where I can store an object in the cookie. For example a person. Some example code would be great.

Cookies
Reply #1 on: June 17, 2006, 18:44:25 PM
Quote from: FuMaN
Im currently developing in VB.NET and have been using Sessions but want to change to cookies. However I have no experience of using this, is it just going to be similar where I can store an object in the cookie. For example a person. Some example code would be great.


Has anything prompted this change? Ive always found sessions *much* better than cookies: If you simply want to keep data after the user has closed their web browser then Id say youd be best storing all the session data to a cookie with a save settings button somewhere on the page (or use a clientside script to do it on navigation away from page) and loading it up again at the start of the next session in a header script. Obv, youll need a session variable that youll use as a flag (maybe cookie_loaded) then your header script can simply have a line like IF cookie_loaded = false then (code to load cookie and set cookie_loaded = true)

  • Offline FuMaN

  • Posts: 250
  • Sr. Member
Cookies
Reply #2 on: June 17, 2006, 21:15:02 PM
The reason for the move is because sessions expire after 20 minutes and for what Im doing I dont want this to occur.

Cookies
Reply #3 on: June 17, 2006, 23:08:43 PM
You can set timeout in Web.Config. Im pretty sure theres an option to make it indefinite...which I think is by setting it to 0...but it might be -1.

0 Members and 1 Guest are viewing this topic.