Professional Web Applications Themes

ASP.NET session management using SQL SERVER - ASP.NET General

This is regarding the session management using Out of proc session management(SQL SERVER). Among the samples below which one is better to set the session? 1. There are 20 session variables and all of them are being stored into session and accessed from session and individual session object. Example: Session["a"] = "XYZ", Session["b"]=100, Session["c"]="NAME", etc. where values are of primitive data type or immediate derivative of the primitive data types. 2. There are 20 session variable, a custom object is created out of them. The custom object is stored into the session. Example: NameValueCollection is an object where data will ...

  1. #1

    Default ASP.NET session management using SQL SERVER

    This is regarding the session management using Out of
    proc session management(SQL SERVER). Among the samples
    below which one is better to set the session?



    1. There are 20 session variables and all of them
    are being stored into session and accessed from session
    and individual session object. Example: Session["a"]
    = "XYZ", Session["b"]=100, Session["c"]="NAME", etc.
    where values are of primitive data type or immediate
    derivative of the primitive data types.

    2. There are 20 session variable, a custom object is
    created out of them. The custom object is stored into the
    session. Example: NameValueCollection is an object where
    data will be stored as NameValueCollection["a"] = "XYZ",
    NameValueCollection["b"]=100, NameValueCollection["c"]
    ="NAME". Finally while storing it in the session the
    NameValueCollection is used as Session["DATA"]=
    NameValueCollection.

    3)Is there any performance issue due to session
    management through SQL SERVER provided by DOTNET framework


    Abhilash.k.m Guest

  2. #2

    Default Re: ASP.NET session management using SQL SERVER

    Some people would disagree, but for the past few years - I pretty much
    consider a SQL server an immediate part of my application. If you have a
    local, semi-robust SQL server - then making calls (like storing session
    information) is pretty negligable..

    So, I would say - you should have a SessionID - write that out as a cookie
    to the client.. then in a database, you have a SessionID that relates to
    whatever session data that you need...

    Same with traditional ASP - "Session" variables are really a bad idea. Even
    if you are not on a cluster/server farm now - at some point you will, and
    that is going to jam up your whole way of dealing with session data. The
    Session object stores things on the local server. So in a server farm
    scenario.. you go to the alias name, and are connected to server1, session
    variables are saved - ON server1. Then you click a link, go to the alias -
    and THIS time you go to server2. When it goes to process your request, it
    can't - because it's not the server where your session data exists... So,
    imho - it's just better to stay away from those and adopt a system that runs
    on everything, and even runs when you get into a scenario when you need
    highly-available servers...

    hth

    "Abhilash.k.m" <com> wrote in message
    news:0d7c01c36b53$aef58750$gbl... 


    Frank Guest

  3. #3

    Default Re: ASP.NET session management using SQL SERVER

    I will elaborate my requirments

    We are developing a mobile web application using ASP.NET
    in a web farm & not planning to use cookies as some
    device browser doesn't support the same.So we are doing
    the session management with the dot frame work provided
    session management using sql server with the values
    entered in WEB.CONFIG file.
    Now we need to set some 20 values to the session .so my
    question is whether we need to add individually as
    session values or store all the 20 values as key value
    pair(say collections).So which is better 1 0r 2?

    1. There are 20 session variables and all of them [/ref]
    is [/ref]
    the [/ref]
    where [/ref]
    = "XYZ", [/ref]

     
    I pretty much 
    application. If you have a 
    storing session 
    that out as a cookie 
    that relates to 
    really a bad idea. Even 
    point you will, and 
    session data. The 
    a server farm 
    to server1, session 
    go to the alias - 
    your request, it 
    data exists... So, 
    adopt a system that runs 
    scenario when you need 
    message [/ref]
    is [/ref]
    the [/ref]
    where [/ref]
    = "XYZ", [/ref]
    framework 
    >
    >
    >.
    >[/ref]
    Abhilash.K.M Guest

  4. #4

    Default Re: ASP.NET session management using SQL SERVER

    In that case, I'd say a collection or an array would be ideal - because you
    can easily iterate through the elements..

    "Abhilash.K.M" <com> wrote in message
    news:07c701c36b57$85255910$gbl... [/ref]
    > is [/ref]
    > the [/ref]
    > where [/ref]
    > = "XYZ", [/ref]
    >

    > I pretty much 
    > application. If you have a 
    > storing session 
    > that out as a cookie 
    > that relates to 
    > really a bad idea. Even 
    > point you will, and 
    > session data. The 
    > a server farm 
    > to server1, session 
    > go to the alias - 
    > your request, it 
    > data exists... So, 
    > adopt a system that runs 
    > scenario when you need 
    > message [/ref]
    > is [/ref]
    > the [/ref]
    > where [/ref]
    > = "XYZ", [/ref]
    > framework 
    > >
    > >
    > >.
    > >[/ref][/ref]


    Frank Guest

  5. #5

    Default Re: ASP.NET session management using SQL SERVER

    I agree. I've had good luck even using DataTables and DataSets in Session
    variables.

    "Frank Drebin" <com> wrote in message
    news:cVx2b.33453$news.prodigy.com... 
    you 
    > > is 
    > > the 
    > > where 
    > > = "XYZ", 
    > >
    > > 
    > > I pretty much 
    > > application. If you have a 
    > > storing session 
    > > that out as a cookie 
    > > that relates to 
    > > really a bad idea. Even 
    > > point you will, and 
    > > session data. The 
    > > a server farm 
    > > to server1, session 
    > > go to the alias - 
    > > your request, it 
    > > data exists... So, 
    > > adopt a system that runs 
    > > scenario when you need 
    > > message 
    > > is 
    > > the 
    > > where 
    > > = "XYZ", 
    > > framework [/ref]
    >
    >[/ref]


    Rick Guest

Similar Threads

  1. Session management in MX
    By Kaliostro in forum Coldfusion Server Administration
    Replies: 2
    Last Post: December 11th, 03:39 AM
  2. Session Management
    By roncfusion in forum Coldfusion - Getting Started
    Replies: 8
    Last Post: December 27th, 01:20 PM
  3. Session Management
    By Mike Blezien in forum Coldfusion Database Access
    Replies: 14
    Last Post: March 9th, 07:28 PM
  4. Session Management: NO Cookies....
    By Sucpraran in forum PERL Miscellaneous
    Replies: 3
    Last Post: September 24th, 05:26 AM
  5. Session State Management
    By Amir Davoodi in forum ASP Database
    Replies: 1
    Last Post: August 22nd, 12:12 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139