session id issue

Last post 07-07-2009 9:19 AM by jeyaseelan@ajsquare.net. 5 replies.

Sort Posts:

  • session id issue

    07-02-2009, 2:23 AM
    • Member
      point Member
    • RITE05
    • Member since 06-18-2009, 2:18 PM
    • Posts 3

    Basically my application is a  car maintenance. Each user can able to see list of shops detail according to their permission.

    For example shop 1 employees cann't  be able to see shop2 details. I am storing their shop number in session id when they login first time  in the system.

     But the issue is, shop 1 employees  are able to see shop 2 details in the middle of the shop 1 process. Same thing happens in shop 2 too. Shop 2 employees are able to see shop 1 details while creating repair order for shop2.

    If any one helps me ... I am really appreciate

         Thanks

     

  • Re: session id issue

    07-02-2009, 4:19 AM
    • Member
      251 point Member
    • chanakya01
    • Member since 06-19-2009, 6:14 AM
    • Mumbai
    • Posts 66

    In which part of your application you are facing this problem??

    Where you are storing the session and retrieving back??

    And where you are displaying the details based on the session value?? 

    Give some code sample so that I can get a clear idea...

    Thanks,

    Chanakya
  • Re: session id issue

    07-02-2009, 2:21 PM
    Answer

     Hi,

    in pageload method you have to write conditions as per your requirement.

    if user1=page1.user then

    do someting

    endif

    if you need more information paste your code snippets here so any one guide you.

    Thanks :)

     

    Remember to click “Mark as Answer” on the post, if it helps you. Because It helps others to find the solution.

    Srinivas Kotra.


  • Re: session id issue

    07-02-2009, 4:10 PM
    • Contributor
      4,278 point Contributor
    • deepthoughts
    • Member since 01-27-2009, 9:55 AM
    • Posts 641

    Well,

    It depends on how you are handling Shops manipulation in your application. In the Page_Load event you can put some check like

    if(Session["ShopID"]!="Shop1")

    {

    Response.Redirect("Unauthorized.aspx");

    }

    to prevent "Shop2" users access a page specifically meant for "Shop1" users.

    Hope it helps.

    MARK AS ANSWER if it helps
  • Re: session id issue

    07-05-2009, 10:39 PM
    Answer

     Hi RITE05,

    You should double check the Session object before comparing the Session objects value.

    I assume that you use the if state to redirect the user to detail page.

    If the Session object lost, your application will redirect to wrong page.

    So, please try to add the following code:

    if(Session["shopnumber"]!=null)
    {
    if(Session["shopnumber"]=="Shop1")
    {
    Response.Redirect("Shop1.aspx");
    }
    else
    {
    Response.Redirect("OtherShop.aspx");
    }
    }
    else
    {
    //redirect to the login page
    }


    I hope it is helpful to you, if you have any questions, please feel free to let me know.

    Best Regards,
    Bober Song
    --------------------------------
    Please remember to click “Mark as Answer” on the post that helps you
  • Re: session id issue

    07-07-2009, 9:19 AM

    RITE05 thanks for your post.

    Your question is not clear, at one place you told

    Each user can able to see list of shops detail according to their permission.

    in another place

    But the issue is, shop 1 employees  are able to see shop 2 details in the middle of the shop 1 process. Same thing happens in shop 2 too. Shop 2 employees are able to see shop 1 details while creating repair order for shop2.

    i'm confused tell me, what exact you want? so that i can help you.

    Any doubts please feel free to ask me.

    If this post is answer of your question then don't forgot to Click Mark As Answer.

    Thanks & Regards,
    J.Jeyaseelan
Page 1 of 1 (6 items)