Sessions

Last post 05-13-2008 2:15 AM by Benson Yu - MSFT. 8 replies.

Sort Posts:

  • Sessions

    05-07-2008, 3:24 AM
    • Loading...
    • rbadis
    • Joined on 04-23-2007, 7:44 AM
    • Posts 222

    Hi,

    does the Session name case sensitive in ASP.NET, so does Session["RegisterID"]=Session["RegisterId"].

     

    Thanks

    badis
  • Re: Sessions

    05-07-2008, 3:38 AM
    • Loading...
    • anzer
    • Joined on 10-19-2004, 4:00 AM
    • UAE
    • Posts 824

    All the state variables (Sesson, Application, Viewstate, Cache, Cookie) are CASE SENSITIVE.

     so Session["RegisterID"] and Session["RegisterId"] will not be same

     

    If this post was useful to you, please mark it as answer.

    My Blog | Free books Microsoft
  • Re: Sessions

    05-08-2008, 1:45 PM
    • Loading...
    • Haissam
    • Joined on 10-05-2006, 6:25 AM
    • Beirut - Lebanon
    • Posts 4,730

    C# is case sensitive. So sure the two session variables you created them are not equal

     

    Haissam Abdul Malak
    MCAD.NET
    | Blog |
  • Re: Sessions

    05-10-2008, 1:11 AM
    • Loading...
    • anzer
    • Joined on 10-19-2004, 4:00 AM
    • UAE
    • Posts 824

     State variables are case sensitive in both VB and C#..

    If this post was useful to you, please mark it as answer.

    My Blog | Free books Microsoft
  • Re: Sessions

    05-10-2008, 1:19 AM

    Session variables are case sensitive

    Regards,

    Prajeesh
    ASP.net Developer
    ipix solutions
    (If this post is helpful, please mark as an answer )
    My Blog:http://prajeeshkk.blogspot.com/
  • Re: Sessions

    05-10-2008, 1:55 AM
    • Loading...
    • anzer
    • Joined on 10-19-2004, 4:00 AM
    • UAE
    • Posts 824

    Hi Prajeesh,
    It seems like you have added an extra line break (<br>) at the end of your blog link and its making the link wrong... Please correct it...

     

     

     

     

    If this post was useful to you, please mark it as answer.

    My Blog | Free books Microsoft
  • Re: Sessions

    05-11-2008, 10:54 PM
    • Loading...
    • rbadis
    • Joined on 04-23-2007, 7:44 AM
    • Posts 222

    Nop, I don't know but I must have some thing wrog in my VS.Net system, because in my system Session["RegisterID"]=Session["RegistedId"].

    So, could you try this bit of code in a sample form:

    string mystring= "";

    Session["badisID"] = "value";

    if(Session["badisId"]!=null)

    mystring=Session["badisId"].ToString();

     

    you will see that mystring="value"

    Thanks

    badis
  • Re: Sessions

    05-12-2008, 1:54 AM
    • Loading...
    • anzer
    • Joined on 10-19-2004, 4:00 AM
    • UAE
    • Posts 824

    Oops am also getting the value.... I tried with with different combination and all worked!!!

    For the last 4 years i thought session variables are case sensitive.. i don't know what is happening here...someone please confirm whether session is case sensitive or not... if case sensitive please explain what is happening in the above code..

     

    If this post was useful to you, please mark it as answer.

    My Blog | Free books Microsoft
  • Re: Sessions

    05-13-2008, 2:15 AM
    Answer
    rbadis:
    string mystring= "";

    Session["badisID"] = "value";

    if(Session["badisId"]!=null)

    mystring=Session["badisId"].ToString();

    you will see that mystring="value"

     

    Hi rbadis,

    Based on my research, the session object is retrieved by this code <return (this.BaseGet(key));> internally. The name of the key is case-insensitive. That’s why we get this result.

    Sincerely,
    Benson Yu
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.
Page 1 of 1 (9 items)
Microsoft Communities
Page view counter