473,387 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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/
Nov 18 '05 #1
3 4520
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" <we*******@carpediem.si> wrote in message
news:eu****************@TK2MSFTNGP11.phx.gbl...
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/

---
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
Nov 18 '05 #2
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" <am*************@SoftHome.net> wrote in message
news:eC****************@tk2msftngp13.phx.gbl...
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" <we*******@carpediem.si> wrote in message
news:eu****************@TK2MSFTNGP11.phx.gbl...
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/

---
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

Nov 18 '05 #3
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" <am*************@SoftHome.net> wrote in message
news:eC****************@tk2msftngp13.phx.gbl...
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" <we*******@carpediem.si> wrote in message
news:eu****************@TK2MSFTNGP11.phx.gbl...
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/

---
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

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jeremy Epstein | last post by:
I've got a 4-page form that lets users enter a whole lot of information, which is then submitted and emailed at the end. All the fields are stored as session data. The whole thing works fine: ...
7
by: Bart Plessers \(artabel\) | last post by:
Hello, My script builds a list of files in a folder. These files are stored in an 2-dimensional array, called "a_files". To speed up the script, I don't want the filelist everytime being read...
1
by: Jawahar Rajan | last post by:
All, I know that using Session.Contents is frowned upon by some. But I feel I am in situation where I cannot avoid it. I think it is better than using a QueryString. Is there a length on the...
2
by: Alex | last post by:
Thank you in advance. My ASP page 1 redirect user to third party's website, after the process at third party is finished, in 3rd party's page, there is one link to route user back to my...
1
by: YT | last post by:
Howdy, Why the heck wouldn't this work: for each item in Session.Contents if NOT( Instr( item, "customer_" ) = 1 OR Instr( item, "user_" ) = 1 ) Then Session.Contents( item ) = ""...
0
by: CJ | last post by:
Hi We have Session Data lost randomly and Session State expired early. Our Intranet Application uses Window Server 2003 and .Net Framework 1.1. We set Session Time out to 60 minutes. but user...
6
by: Cecil Westerhof | last post by:
I have the following code: for each SesVar in Session.Contents if( Session.Contents(SesVar) <> "" ) then The problem is that most of the time this works okay, but sometimes the code crashes...
3
by: manonoc | last post by:
Hi everyone, This appears only under IE, under Firefox there is no problems: the session is lost, when i use the DNS name in the url (if i use the ip adress, or the server name, there is no...
6
by: tshad | last post by:
Is there a reason to use session.remove over session.contents.remove? Don't they both remove the key and data from the contents collection? I assume that session(x) = nothing does essentially...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.