Verify Session Values

4 posts, 0 answers
  1. Lee
    Lee avatar
    4 posts
    Member since:
    May 2009

    Posted 23 Feb 2011 Link to this post

    We stored values in our session in our site.

    I see we can access cookies, but how can I verify session values?
  2. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 23 Feb 2011 Link to this post

    Hi Lee,

    I'm not sure I understand your question. I know what a cookie is, but I'm not sure what a "session value" is to you. Is this some piece of data that is stored in your server? Is it stored in the URL? Is it stored in the browser somehow (in a cookie)?

    I'm going to assume it is a piece of data stored by the application running on the server. There is kind of a brick wall between the framework and what is running on the web server. We can only access the DOM from the browser and the cookies for it. We cannot directly access anything contained on the server.

    If you can come up with some mechanism to access this server data and present it in the browser, such as a special URL that fetches reads and returns this session data in the browser then we'll be able to access it.

    Beyond that I need clarification on what/where this session value is so we can assist you with how to access and validate it.

    Regards,
    Cody
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. Lee
    Lee avatar
    4 posts
    Member since:
    May 2009

    Posted 24 Feb 2011 Link to this post

    For cookies, we stored global values like location, language etc...

    for User settings, like permissions, user settings..
    These are stored in sessions..
    http://msdn.microsoft.com/en-us/library/ms178581.aspx

    example..
    HttpContext.Current.Session["username"] = "myuser";

    I want to be sure they are populated

    I'm sure it isnt possible since its server side, but just clarifying what my post was originally asking,
    If this isn't possible, I might just need to write a temporary web service inside page for verifying sessions
    or something similar
  4. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 01 Mar 2011 Link to this post

    Hello Lee,

    As I understand it, your session values are stored on the server itself in one form or another per http://msdn.microsoft.com/en-us/library/ms178586.aspx. A session ID number is transferred between the browser and the server and then the server looks up the session state (which gives the server code a HttpContext) from its server side storage according to this ID value.

    This means our framework does not have the ability to get at this information directly. We can only get at the information that is kept in the browser.

    Yes your temporary web service would probably be the best approach at getting anything that is stored server side.

    Regards,
    Cody
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Back to Top