Session automatically expires

Last post 07-02-2009 8:54 AM by sureshmdb. 7 replies.

Sort Posts:

  • Session automatically expires

    06-27-2009, 12:32 AM
    • Member
      39 point Member
    • manojbang
    • Member since 06-22-2009, 9:48 AM
    • Posts 22

    hi.

    i designed  website is in different languages. give menu bar to user to select language . for that i used session which stores the value of selected language. when user select language suppose "English"  website comes in english. after that user select language "Spanish"  it comes in spanish but after that  user click on different link avilable on website  it goes to "English" instead of spanish    i dont understand why this happens?  i have mentioned in web.config session timeout.

     

     

    <sessionState mode="InProc" timeout="60"></sessionState>
     
    plz  give solution to this problem?????????
     
    Thanks 


     

     

     

     

  • Re: Session automatically expires

    06-27-2009, 1:48 AM
    • All-Star
      57,569 point All-Star
    • mudassarkhan
    • Member since 02-28-2008, 10:28 AM
    • Mumbai, India
    • Posts 10,197
    • TrustedFriends-MVPs

    To verify check whether the session variable goes null since if it does not then something wrong in your logic and not session

    MAK [MVP ASP/ASP.Net]

    ASP.Net Consultant My Site : ASPSnippets

    Delete mutiple rows in GridView

    Using AsyncFileUpload Control
  • Re: Session automatically expires

    06-27-2009, 1:55 AM
    • Member
      315 point Member
    • sureshmdb
    • Member since 05-27-2008, 8:18 AM
    • Baleru
    • Posts 61

     Hi Manoj,

                    May be this is not a session problem,becouse it is working for Dropdownlist selection 'English' if any problem with session then it has problem with Engliesh aslo but it is not happend,please can you give breif disc or send sample code.

    bellow code for sessions in web.config file

    <sessionState cookieless="false" mode="InProc" stateNetworkTimeout="100" sqlCommandTimeout="90"></sessionState>

    Suresh Mediboyina



    Mark as answer if my response is useful to you.
  • Re: Session automatically expires

    06-27-2009, 3:04 AM
    • Member
      39 point Member
    • manojbang
    • Member since 06-22-2009, 9:48 AM
    • Posts 22
    hi suresh 
    thanx for ur reply i have created property named sessionhandler  
     
    public static class SessionHandler
        {
    
            /// <summary>
            /// Culture Session variable    
            /// Setting the culture for the current session
            /// </summary>
            #region "Culture"
            private static string _Culture = "Culture";
            public static string Culture
            {
                get
                {
                    if (HttpContext.Current.Session[SessionHandler._Culture] == null)
                    {
                        return "en_US";
                        //return "";
                    }
                    else
                        return HttpContext.Current.Session[SessionHandler._Culture].ToString();
    
                }
    
                set
                { HttpContext.Current.Session[SessionHandler._Culture] = value; }
            }
    
    
            #endregion
    
    
            calling this property on master page langage menu selection 
     
     protected void MnuLanguage_Click(object sender, MenuEventArgs e)
        {
            if (e.Item.Text.Trim() != "Languages")
            {
                SessionHandler.Culture = e.Item.Value; //           MnuLanguage.SelectedValue.ToString();
            }
            Response.Redirect("~/Webpages/Homepage.aspx");
                    
        }
     
    please reply

     


     

    Filed under:
  • Re: Session automatically expires

    06-27-2009, 3:17 AM
    • Member
      39 point Member
    • manojbang
    • Member since 06-22-2009, 9:48 AM
    • Posts 22

     hi...

    plz check this site http://www.salusalpha.com   please select language. mentioned problem occured with this site

     

  • Re: Session automatically expires

    06-27-2009, 6:17 AM
    • Member
      315 point Member
    • sureshmdb
    • Member since 05-27-2008, 8:18 AM
    • Baleru
    • Posts 61

     Hi Manoj,

            This site (http://www.salusalpha.com) which you've prodived is working fine,I selected all languages tried more than 8 times

    Suresh Mediboyina



    Mark as answer if my response is useful to you.
  • Re: Session automatically expires

    06-27-2009, 6:25 AM
    • Member
      315 point Member
    • sureshmdb
    • Member since 05-27-2008, 8:18 AM
    • Baleru
    • Posts 61

     Hi Manoj,

            The site is good,As I'm checking with session problem I objerved some little bit issue like newsletter lable text is displaying for english only other language not displying,

    Suresh Mediboyina



    Mark as answer if my response is useful to you.
  • Re: Session automatically expires

    07-02-2009, 8:54 AM
    Answer
    • Member
      315 point Member
    • sureshmdb
    • Member since 05-27-2008, 8:18 AM
    • Baleru
    • Posts 61

     Hi Manoj,

             Log files also one of the factor to kill the  Sessions ,if log file length is increased more than 60MB then server(IIS) people restricted the application,then server objects are cleared.please check with your database log files

     

     

    Suresh Mediboyina



    Mark as answer if my response is useful to you.
Page 1 of 1 (8 items)