c# - Session Getting Lossed after Hyperlink Clicked -
i have gridview gets hyperlink values table append navigateurl of hyperlink so
<asp:hyperlink id="linksection" runat="server" text='<%# eval("section") %>' navigateurl='<%# "http://localhost:50686/" + (string)eval("section") + ".aspx"%>'>
everything seemed work great while debugging horror started once went deploy website. noticed iis uses inproc sessions not sure visual studios uses while debugging works great.
once go webconfig file , manually set session variables use inproc
<sessionstate mode="inproc" cookieless="true" regenerateexpiredsessionid="true" timeout="30" />
my application no longer works seems losing session value once click hyperlink. added logic redirect login page if session value null , funny part once click link , sends me login page, if log in works sometimes.
i setting session value so
session["loggedinuser"] = txtemail.text;
and retrieve
cmd.parameters["@emailacct"].value = session["loggedinuser"];
i not deploying server farm stick best performance method of session read inproc if possible.
looks while playing sessionstate mode have overlooked cookieless option. mode=inproc , cookieless=true, asp.net uses url store session id. if use absolute url, asp.net can't append sessionid. work around convert url relative url this:
navigateurl = response.applyapppathmodifier(yoururl);
here discussion, may find helpful.
Comments
Post a Comment