Click here to Skip to main content
15,887,683 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Get original string from Guid Pin
Kornfeld Eliyahu Peter13-Aug-14 22:27
professionalKornfeld Eliyahu Peter13-Aug-14 22:27 
AnswerRe: Get original string from Guid Pin
Richard MacCutchan13-Aug-14 22:28
mveRichard MacCutchan13-Aug-14 22:28 
QuestionRe: Get original string from Guid Pin
Member 947380915-Aug-14 18:49
Member 947380915-Aug-14 18:49 
QuestionDynamic Linq Query in vb.net Pin
murali_utr12-Aug-14 18:51
murali_utr12-Aug-14 18:51 
AnswerRe: Dynamic Linq Query in vb.net Pin
Bernhard Hiller12-Aug-14 21:11
Bernhard Hiller12-Aug-14 21:11 
QuestionFetch data from database based checkboxlist selection getting error Pin
Venugopal626412-Aug-14 17:34
Venugopal626412-Aug-14 17:34 
AnswerRe: Fetch data from database based checkboxlist selection getting error Pin
Bernhard Hiller12-Aug-14 21:14
Bernhard Hiller12-Aug-14 21:14 
QuestionSession variable expires even though session time was set to 9 hours. Pin
Kandepu Rajesh12-Aug-14 9:12
Kandepu Rajesh12-Aug-14 9:12 
Hai All,

I am using forms authentication and set the timeout to 539 minutes. Also I have set the session-state timeout to 540 mins in web.config. Also I have set the same in IIS manager also. But after 20 mins the session variable expires and it throws exception "Object reference not set". Could any one please tell me where I went wrong.

<authentication mode="Forms">
<forms loginUrl="~/Login.aspx" timeout="539" slidingExpiration="true"/>
</authentication>


<sessionState
mode="InProc"
cookieless="false"
timeout="540"/>
</system.web>

Code in Login.aspx.cs

Session["userprofile"] = ds;
FormsAuthenticationTicket tkt;
string cookiestr;
HttpCookie ck;
tkt = new FormsAuthenticationTicket(1, UserName.Text, DateTime.Now, DateTime.Now.AddMinutes(539), RememberMe.Checked, "your custom data");
cookiestr = FormsAuthentication.Encrypt(tkt);
ck = new HttpCookie(FormsAuthentication.FormsCookieName, cookiestr);
if (RememberMe.Checked)
ck.Expires = tkt.Expiration;
ck.Path = FormsAuthentication.FormsCookiePath;
Response.Cookies.Add(ck);

string strRedirect;
strRedirect = Request["ReturnUrl"];
if (strRedirect == null)
strRedirect = "default.aspx";
Response.Redirect(strRedirect, false);


Regards,
Rajesh Kandepu
AnswerRe: Session variable expires even though session time was set to 9 hours. Pin
Kornfeld Eliyahu Peter12-Aug-14 20:20
professionalKornfeld Eliyahu Peter12-Aug-14 20:20 
AnswerRe: Session variable expires even though session time was set to 9 hours. Pin
Swinkaran12-Aug-14 21:28
professionalSwinkaran12-Aug-14 21:28 
QuestionSession_Start not fire in IIS7 - Windows Server 2008 (64bit) Pin
android_lee11-Aug-14 23:01
professionalandroid_lee11-Aug-14 23:01 
AnswerRe: Session_Start not fire in IIS7 - Windows Server 2008 (64bit) Pin
Kornfeld Eliyahu Peter12-Aug-14 20:29
professionalKornfeld Eliyahu Peter12-Aug-14 20:29 
GeneralRe: Session_Start not fire in IIS7 - Windows Server 2008 (64bit) Pin
android_lee17-Aug-14 21:49
professionalandroid_lee17-Aug-14 21:49 
QuestionHow do I customize the URL users get sent to after logging out (ServiceStack)? Pin
JMK-NI9-Aug-14 23:37
professionalJMK-NI9-Aug-14 23:37 
AnswerRe: How do I customize the URL users get sent to after logging out (ServiceStack)? Pin
Kornfeld Eliyahu Peter10-Aug-14 2:07
professionalKornfeld Eliyahu Peter10-Aug-14 2:07 
Questionproblem after publishing a website Pin
Member 105108496-Aug-14 22:50
Member 105108496-Aug-14 22:50 
AnswerRe: problem after publishing a website Pin
jkirkerx7-Aug-14 10:45
professionaljkirkerx7-Aug-14 10:45 
GeneralRe: problem after publishing a website Pin
Member 1051084911-Aug-14 21:37
Member 1051084911-Aug-14 21:37 
AnswerRe: problem after publishing a website Pin
Bernhard Hiller7-Aug-14 21:33
Bernhard Hiller7-Aug-14 21:33 
QuestionA custom error instead of built in error Pin
ThetaClear6-Aug-14 22:05
ThetaClear6-Aug-14 22:05 
AnswerRe: A custom error instead of built in error Pin
Richard Deeming7-Aug-14 1:47
mveRichard Deeming7-Aug-14 1:47 
GeneralRe: A custom error instead of built in error Pin
ThetaClear7-Aug-14 4:16
ThetaClear7-Aug-14 4:16 
QuestionNee to prepare for Audit trails for my web application Pin
demoninside95-Aug-14 19:57
demoninside95-Aug-14 19:57 
AnswerRe: Nee to prepare for Audit trails for my web application Pin
Richard MacCutchan6-Aug-14 5:19
mveRichard MacCutchan6-Aug-14 5:19 
QuestionAsp,net web hosting Pin
Otekpo Emmanuel5-Aug-14 15:31
Otekpo Emmanuel5-Aug-14 15:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.