Re: Cookie and Webpage Question



Mark,

Thanks for the post. I am assuming that what you mean by sticky sessions is
use ASP.Net Session state InProc mode. This method is not scalable and I do
not want to force my user to access the same webserver (it kind of defeats
the purpose). You do make a good point about cookies and probably should
use a different method. I really do not want to store session state in a
SQL DB because:

1) I am not storing a lot of data
2) Not scalable
3) Performance

I will continue to look into session state.

Thanks

"Mark Rae" <mark@xxxxxxxxxxxxxxxxx> wrote in message
news:%23cjcnJiGHHA.4712@xxxxxxxxxxxxxxxxxxxxxxx
"Mike" <mikey@xxxxxxxx> wrote in message
news:OjEeeCiGHHA.3468@xxxxxxxxxxxxxxxxxxxxxxx

Upon login into my application I stored user data (userid, ...) in a
cookie to be used throughout the application.

Hmm...

One particular form is very complicated that uses AJAX and many AJAX
postbacks it needs data from that cookie. Is it bad practice to keep
opening that cookie to get data each request or should I store it (hidden
fields ...)?

Why can't you use use ViewState? Read the cookie when the page first loads
and cache it in ViewState.

In the future this application will be on multiple webservers (replicated
with a load balancer in front) so my options are limited.

In what way(s) are your options limited...? You're talking about
non-sticky sessions...? There are plenty of solutions for that...

http://www.microsoft.com/technet/archive/itsolutions/ecommerce/maintain/operate/d5nlb.mspx?mfr=true
http://www.microsoft.com/technet/prodtechnol/windows2000serv/technologies/iis/deploy/confeat/webclust.mspx
http://technet2.microsoft.com/WindowsServer/en/library/6ac4a6ba-1c0c-46be-8c6a-2c2e0e567e981033.mspx?mfr=true

I chose not to go with storing session state in SQL DB because of
performance issues.

Performance issues...?

I have a small amount of data that I need to store per session which can
be stored in a cookie and it is a simple solution.

Presumably this is a public website? What are you going to do if people
have disabled cookes...?

Any suggestions?

Use sticky sessions.



.



Relevant Pages

  • Re: persistant cookie, what is it?
    ... Why don't you use Session State? ... cookie to identify the client. ... All you need to do to not persist a cookie is not to set ... client until the domain is navigated away from, or the browser is closed. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Role Providers Cache
    ... If you are trying to avoid using session state (always a good idea in my ... the values in the cookie as the representative byte array of the roles. ... Co-author of "The .NET Developer's Guide to Directory Services Programming" ... We will be writting our own role provider but would like to do ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Programatically Login
    ... If it is view state or session state, then you can enter the information on ... If it is a cookie, then when you login you will have to capture the cookie ... can I do this using the HttpRequest and HttpResponse methods? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Wont save session object
    ... URL: http://localhost/program.aspx it runs the session objects fine, ... Here is the session state object in my web.config file: ... > client machine's cookie setting. ...
    (microsoft.public.dotnet.framework.aspnet)