Connecting Tech Pros Worldwide Help | Site Map

Session contents lost despite Session.Timeout = 3000; and <sessionState mode="InProc" cookieless="false" timeout="300">

Carpe Diem
Guest
 
Posts: n/a
#1: Nov 18 '05
Hello I have an aspx page that loses Session("user") value after a few
minutes even after I set
<sessionState mode="InProc" cookieless="false" timeout="300"> in web.config
and wrote
function Session_Start() {
Session.Timeout = 3000;
}

in global.asax

Can you give me pointers on how to achieve the required functionality?

--
Jure Spik,
Carpe Diem d.o.o., Kranj

http://carpediem.si/


.NET Follower
Guest
 
Posts: n/a
#2: Nov 18 '05

re: Session contents lost despite Session.Timeout = 3000; and <sessionState mode="InProc" cookieless="false" timeout="300">


hi,
that is not possible ..
and no need to specify timeout to be 300.
just 10 or 20 will do...

try to find the exact reason why sessio is not mantained..

plz send some snippet of code...


--
Thanks and Regards,

Amit Agarwal
Software Programmer(.NET)
"Carpe Diem" <webdesign@carpediem.si> wrote in message
news:euHpJM%239DHA.2064@TK2MSFTNGP11.phx.gbl...[color=blue]
> Hello I have an aspx page that loses Session("user") value after a few
> minutes even after I set
> <sessionState mode="InProc" cookieless="false" timeout="300"> in[/color]
web.config[color=blue]
> and wrote
> function Session_Start() {
> Session.Timeout = 3000;
> }
>
> in global.asax
>
> Can you give me pointers on how to achieve the required functionality?
>
> --
> Jure Spik,
> Carpe Diem d.o.o., Kranj
>
> http://carpediem.si/
>
>[/color]


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.593 / Virus Database: 376 - Release Date: 2/20/2004


William LaMartin
Guest
 
Posts: n/a
#3: Nov 18 '05

re: Session contents lost despite Session.Timeout = 3000; and <sessionState mode="InProc" cookieless="false" timeout="300">


I had a problem with session variables disappearing within one minute of
being created at sites hosted by one web host. I got them to increase the
Virtual memory limit on their application pools. That reduced recycling and
increased session durations.


".NET Follower" <amitagarwal-NET@SoftHome.net> wrote in message
news:eCnwy4H%23DHA.3436@tk2msftngp13.phx.gbl...[color=blue]
> hi,
> that is not possible ..
> and no need to specify timeout to be 300.
> just 10 or 20 will do...
>
> try to find the exact reason why sessio is not mantained..
>
> plz send some snippet of code...
>
>
> --
> Thanks and Regards,
>
> Amit Agarwal
> Software Programmer(.NET)
> "Carpe Diem" <webdesign@carpediem.si> wrote in message
> news:euHpJM%239DHA.2064@TK2MSFTNGP11.phx.gbl...[color=green]
> > Hello I have an aspx page that loses Session("user") value after a few
> > minutes even after I set
> > <sessionState mode="InProc" cookieless="false" timeout="300"> in[/color]
> web.config[color=green]
> > and wrote
> > function Session_Start() {
> > Session.Timeout = 3000;
> > }
> >
> > in global.asax
> >
> > Can you give me pointers on how to achieve the required functionality?
> >
> > --
> > Jure Spik,
> > Carpe Diem d.o.o., Kranj
> >
> > http://carpediem.si/
> >
> >[/color]
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.593 / Virus Database: 376 - Release Date: 2/20/2004
>
>[/color]


Carpe Diem
Guest
 
Posts: n/a
#4: Nov 18 '05

re: Session contents lost despite Session.Timeout = 3000; and <sessionState mode="InProc" cookieless="false" timeout="300">


some code::
list.aspx:: (this is the page that timeouts early)
<%@ Page Language="JScript" debug='true' Strict="true" Explicit="true"
Trace="false" enableSessionState="true" EnableViewState="true" Buffer="true"
%>
<script runat='server'>
var user : String;

function Page_Load(src : Object, e : EventArgs) {
user = String(Session("loggedIn"));
if (user == null || user == "null" || user == "" || user == "undefined") {
Response.Redirect("mailing_login.aspx?authorised=n o");
Response.End();
}
//some data display
}
</script>
<form runat='server'>
<%=mailingListName%> subscribers:<br />
<br />
<span id="subscribersMsg" runat='server' /><br />
<asp:DataList id='subscribers' runat='server'>
<ItemTemplate>
<a href='deleteSubscriber.aspx?subscriberId=<%#
Int32(Container.DataItem("SubscriberID"))
%>&amp;mailingListId=<%=mailingListID%>' onClick='return(confirm("Are you
sure you want to delete subscriber <%#
String(Container.DataItem("SubscriberEmail")) %> (no undo
possible)?"));'>delete</a>
<%# String(Container.DataItem("SubscriberEmail")) %><br />
</ItemTemplate>
</asp:DataList>
</form>
<input type='button' value='add subscriber' runat='server'>

----------------------------------------------------------------------------
---------------------------------------------------------

mailing_login.aspx:: (login page)
<%@ Page Language="JScript" debug='false' Strict="true" Explicit="true"
Trace="false" EnableSessionState="true" EnableViewState="false"
Buffer="true" %>

<HTML>
<head>
<script language='JScript' runat='server'>
function Page_Load() {
if (Request.QueryString("authorised") != null) {
Msg.Text = "You must login to access this site.<br />"
}
}
function LoginBtn_Click(sender : Object, e : EventArgs) {
//get user from database

if (userFound) {
Session("loggedIn") = UserName.Text;
Response.Redirect("default.aspx");
} else {
Msg.Text += "Invalid Credentials: Please try again.<br />";
}
}
</script>
<form runat="server">
<h2>Mailing List :: Login Page</h2>
<hr size="1" />
<table>
<tr>
<td>Username:</td>
<td><asp:TextBox id="UserName" runat="server" /></td>
<td><asp:RequiredFieldValidator id="userRequired" runat="server"
ControlToValidate="UserName" Display="Static" ErrorMessage="Missing!"
/></td>
</tr>
<tr>
<td>Password:</td>
<td><asp:TextBox id="UserPass" runat="server" TextMode="Password"
/></td>
<td><asp:RequiredFieldValidator id="passRequired" runat="server"
ControlToValidate="UserPass" Display="Static" ErrorMessage="Missing!"
/></td>
</tr>
</table>
<asp:button id="LoginBtn" onclick="LoginBtn_Click" runat="server"
text="Login" />
<p><asp:Label id="Msg" runat="server" ForeColor="red" /></p>
</form>

</head>
<body>
</body>
</HTML>


--
Jure Spik

".NET Follower" <amitagarwal-NET@SoftHome.net> wrote in message
news:eCnwy4H%23DHA.3436@tk2msftngp13.phx.gbl...[color=blue]
> hi,
> that is not possible ..
> and no need to specify timeout to be 300.
> just 10 or 20 will do...
>
> try to find the exact reason why sessio is not mantained..
>
> plz send some snippet of code...
>
>
> --
> Thanks and Regards,
>
> Amit Agarwal
> Software Programmer(.NET)
> "Carpe Diem" <webdesign@carpediem.si> wrote in message
> news:euHpJM%239DHA.2064@TK2MSFTNGP11.phx.gbl...[color=green]
> > Hello I have an aspx page that loses Session("user") value after a few
> > minutes even after I set
> > <sessionState mode="InProc" cookieless="false" timeout="300"> in[/color]
> web.config[color=green]
> > and wrote
> > function Session_Start() {
> > Session.Timeout = 3000;
> > }
> >
> > in global.asax
> >
> > Can you give me pointers on how to achieve the required functionality?
> >
> > --
> > Jure Spik,
> > Carpe Diem d.o.o., Kranj
> >
> > http://carpediem.si/
> >
> >[/color]
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.593 / Virus Database: 376 - Release Date: 2/20/2004
>
>[/color]


Closed Thread