Click here to Skip to main content
15,915,163 members
Home / Discussions / C#
   

C#

 
GeneralSystem.Net.dll does not exist! Pin
23-Apr-02 3:58
suss23-Apr-02 3:58 
GeneralRe: System.Net.dll does not exist! Pin
Gavin_Mannion23-Apr-02 4:10
Gavin_Mannion23-Apr-02 4:10 
GeneralRe: System.Net.dll does not exist! Pin
James T. Johnson23-Apr-02 4:19
James T. Johnson23-Apr-02 4:19 
GeneralRe: System.Net.dll does not exist! Pin
23-Apr-02 4:38
suss23-Apr-02 4:38 
GeneralRe: System.Net.dll does not exist! Pin
James T. Johnson23-Apr-02 5:15
James T. Johnson23-Apr-02 5:15 
GeneralRe: System.Net.dll does not exist! Pin
Kannan Kalyanaraman24-Apr-02 2:57
Kannan Kalyanaraman24-Apr-02 2:57 
General!!!Cookies!!! Pin
Gavin_Mannion23-Apr-02 2:49
Gavin_Mannion23-Apr-02 2:49 
GeneralRe: !!!Cookies!!! Pin
James T. Johnson23-Apr-02 5:09
James T. Johnson23-Apr-02 5:09 
It appears you're right, the cookies are reset after each round trip; but the more I thought about it the more it made sense. A cookie is just text that is passed back and forth between the server and the client. And if memory serves correctly to not pass the cookie back to the client tells the client to delete the cookie.

One thing you can do to preserve the cookies is to loop through the list and re-add the cookie to the response.

for( int i = 0; i < Request.Cookies.Count; i++ )<br />
{<br />
  Response.Cookies.Add(Request.Cookies[i]);<br />
}


This is something I think ASP did for you, but I don't remember off hand.

Now, to save you from bickering from your users; PLEASE don't use cookies to store that much data Smile | :) Its okay to store a few bits, but you are limited in your cookie space by most browsers; and that is more traffic that goes to the server and back to the client.

ASP.NET's session object is now webfarm friendly with use of either an out-of-proc server or using SQL Server as the session state holder.

With that said you're going to need a way to store your data, if you can't use a database to store the data then at least put all your data in a memory stream (or some other form so it is one contigous block), compress it, then base64 encode it and store that in the cookie. The space you save will make your users and your provider happy Smile | :)

Good Luck,

James

Simplicity Rules!
GeneralRe: !!!Cookies!!! Pin
Gavin_Mannion23-Apr-02 5:19
Gavin_Mannion23-Apr-02 5:19 
GeneralRe: !!!Cookies!!! Pin
James T. Johnson23-Apr-02 8:36
James T. Johnson23-Apr-02 8:36 
GeneralCenter Child Window in SDI Pin
Benjamin Chua22-Apr-02 15:34
Benjamin Chua22-Apr-02 15:34 
GeneralRe: Center Child Window in SDI Pin
James T. Johnson23-Apr-02 2:59
James T. Johnson23-Apr-02 2:59 
QuestionC# colour picker ??? Pin
Christian Graus22-Apr-02 12:34
protectorChristian Graus22-Apr-02 12:34 
AnswerRe: C# colour picker ??? Pin
Neil Van Note22-Apr-02 12:48
Neil Van Note22-Apr-02 12:48 
GeneralArrayList modify Items Pin
Ignacio Varas22-Apr-02 5:01
Ignacio Varas22-Apr-02 5:01 
GeneralRe: ArrayList modify Items Pin
Neil Van Note22-Apr-02 6:46
Neil Van Note22-Apr-02 6:46 
GeneralProperty vs Attribute Pin
Chris Hafey22-Apr-02 5:00
Chris Hafey22-Apr-02 5:00 
GeneralRe: Property vs Attribute Pin
Nish Nishant22-Apr-02 8:24
sitebuilderNish Nishant22-Apr-02 8:24 
GeneralRe: Property vs Attribute Pin
James T. Johnson22-Apr-02 21:38
James T. Johnson22-Apr-02 21:38 
GeneralRe: Property vs Attribute Pin
Neil Van Note23-Apr-02 2:42
Neil Van Note23-Apr-02 2:42 
GeneralChecking to see if a cookie exists Pin
Gavin_Mannion22-Apr-02 4:44
Gavin_Mannion22-Apr-02 4:44 
GeneralRe: Checking to see if a cookie exists Pin
James T. Johnson23-Apr-02 3:43
James T. Johnson23-Apr-02 3:43 
GeneralRe: Checking to see if a cookie exists Pin
Gavin_Mannion23-Apr-02 3:45
Gavin_Mannion23-Apr-02 3:45 
GeneralRe: Checking to see if a cookie exists Pin
James T. Johnson23-Apr-02 3:53
James T. Johnson23-Apr-02 3:53 
GeneralRe: Checking to see if a cookie exists Pin
Gavin_Mannion23-Apr-02 4:05
Gavin_Mannion23-Apr-02 4:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.