session does not work

Discussion in 'Site Programming, Development and Design' started by Rsafa, Aug 25, 2012.

  1. Hi all

    I use asp to write the codes. Since the following changes had been done, if i set session in a page, as soon as I leave that page and try to read session in new page, it is empty.

    -- I downloaded iis 7 manager and forced the site to only works in https.

    -- In order to hide the ip address of the site, I seperated the informative part of the site in another host, and it shows http in the first glance.

    -- I made a link as "login" and linked to a domani that i had.

    -- i went to godaddy and forward the secondry domain to the actual ip address of Winhost. (https) I chose to mask the address bar.

    -- in iis7 manager, I checked to make sure that Sessions are activated.

    -- now simply, I send user name and password to the secure page:
    <%
    Dim UiD, Upass

    'getting the user name and save it in a session
    UiD = CStr( Request( "uName" ) )
    Upass = CStr( Request( "pWord" ) )
    Session("MyLogin") = UiD
    Response.Redirect("testSession.asp")


    %>​

    -- in the test page:
    <%
    DIM UiD
    UiD = Session("MyLogin")
    Response.write(UiD)
    %>​

    it is empty.

    Thank you
     
    Last edited by a moderator: Oct 14, 2015
  2. seriously? it's been 4 days and no one bother to response ...
    Since then, I changed the setting and removed the https (forced). As well a direct link to the login page was made. It's not working. ... I need help please.
     
  3. I can't speak for everyone, but your description is kind of confusing, so I have no idea what you're trying to accomplish.
     
  4. I just want my sessions to work. As soon as I move from one page to another, they get deleted. There is nothing inside them. (the session exist, however it is empty)
    Ramin
     
  5. never mind, I change things 100 times and eventually it works. SOmething was wrong with my iis 7 manager. thank you. I'll try to finish this application this week. I may have to post more questions. PLEASE understand that I am a doctor and this was my summer project and the customer is my wife ... I know, a wrong choice. It is too late now. Just help me to finish this. It will never happen again ... thank you
     
  6. ComputerMan

    ComputerMan Winhost Staff

    Some information you want to know about our hosting environment below:

    If your sessions are being lost. You might want to read our knowledge base article on how to enable SQL Server sessions on your web application here: http://support.Winhost.com/KB/a626/how-to-enable-aspnet-sql-server-session-on-your-web.aspx

    We host each website in its unique application pool/process. To ensure server stability we recycle the application if any of the following conditions are met:

    1) More than 20 minutes of idle time (no HTTP request in 20 minutes)
    2) The application uses more than 100 MB of memory for the Basic plan and 200 MB of memory for the Max and 300 MB of memory for the Ultimate plan.
    3) The application uses more than 70% of CPU resources for more than 5 minutes

    If your web application pool recycles then most likely your sessions will be lost. To avoid this from happening you can use SQL Server sessions in order to retain your sessions even if your application pool recycles.
     
    Last edited by a moderator: Oct 14, 2015

Share This Page