1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Session questions

Session questions

7 posts, 1 answered
  1. Shawn Davis
    Shawn Davis avatar
    81 posts
    Registered:
    13 Oct 2012
    23 Apr 2010
    Link to this post
    What is the timeout set to currently and if I want to extend it would I use something like this in web.config?

    <

     

    sessionState cookieless="AutoDetect" timeout="60"/>

     


    Also, I frequently check session variables at Page_Load and redirect if they are not correct.  When drop these controls on a page during design the variables are of course not correct and the page gets redirected immediately.  What could I look for during design to loop around my redirects?

    Thanks!
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    25 Apr 2010
    Link to this post
    Hello Shawn Davis,

    The timeout specifies the number of minutes a session can be idle before it is abandoned. The default is 20.

    <configuration>
       <system.web>
          <sessionState mode="InProc"
                        cookieless="true"
                        timeout="20"/>
          </sessionState>
       </system.web>
    </configuration>

    For the second issue, do not make redirects when you are in edit mode

    if (!HttpContext.Current.Request.QueryString["cmspagemode"] == "edit")
    {
      // you are not in edit mode. Make check for the session and make redirect.
      
    }


    Greetings,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
    Answered
  3. Shawn Davis
    Shawn Davis avatar
    81 posts
    Registered:
    13 Oct 2012
    26 Apr 2010
    Link to this post
    Great - thank you!
  4. Shawn Davis
    Shawn Davis avatar
    81 posts
    Registered:
    13 Oct 2012
    10 May 2010
    Link to this post
    I tried inserting this into my web.config
    <sessionState mode="InProc" cookieless="true" timeout="60"/>
    and it caused the site to start throwing an error.

    Invalid Page request! The CMS entry point should never be called directly.

    Did I do something wrong?
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    10 May 2010
    Link to this post
    Hello Shawn Davis,

    Set cookieless="false". This should fix the error.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. Shawn Davis
    Shawn Davis avatar
    81 posts
    Registered:
    13 Oct 2012
    14 May 2010
    Link to this post
    I tried the new session cose and still received an error, so I punched in this:
    <sessionState cookieless="AutoDetect" timeout="60"/>

    and that seems to work do I need to include the Mode?

    Thanks.
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    14 May 2010
    Link to this post
    Hello Shawn Davis,

    It depends on whether you want to store the session, but from your reply it looks like that "Off" should be set in your configuration.

    mode     Specifies where to store the session state.
        Off Indicates that session state is not enabled.
        InProc Indicates that session state is stored locally.
        StateServer Indicates that session state is stored on a remote server.
        SQLServer Indicates that session state is stored on the SQL Server.


    Greetings,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Register for webinar
7 posts, 1 answered