Ask a Question related to Dreamweaver AppDev, Design and Development.
-
bthouin #1
Session timeout: how to find out ?
Hi,
While I am developing my app (DW MX 2004, ASP, VBSCript, SQLServer), I
hit again and again a session timeout, because I code for a long while
before refreshing my page. I virtually always get a message like this:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax
near '='.
This is because I use session variables quite a bit in my DB accesses.
Now, how can I elegantly detect that the session has timed out so that
my future users won't see this ugly message, if they access a page, then
have their coffee break without exiting the page, and just refresh it
when coming back?
This can happen of course at many different places in my app, i.e.
whenever I use a session variable. I don't really fancy putting checking
code in each and every of my DB accesses for finding empty values of the
access attributes...
What's your way of dealing with that problem (apart from declaring that
the session should never expire...) ?
And what should I show the users? They of course should login again, but
how do I tell them?
Thanks for your advice.
Bernard
bthouin Guest
-
#25116 [Com]: PHP can't find session, it starts the new session
ID: 25116 Comment by: DiosV2 at AOL dot com Reported By: leo dot jokinen at laurea dot fi Status: Bogus Bug... -
#25116 [Fbk->Opn]: PHP can't find session, it starts the new session
ID: 25116 User updated by: leo dot jokinen at laurea dot fi Reported By: leo dot jokinen at laurea dot fi -Status: ... -
#25116 [Bgs->Opn]: PHP can't find session, it starts the new session
ID: 25116 User updated by: leo dot jokinen at laurea dot fi Reported By: leo dot jokinen at laurea dot fi -Status: ... -
#25116 [Opn->Fbk]: PHP can't find session, it starts the new session
ID: 25116 Updated by: derick@php.net Reported By: leo dot jokinen at laurea dot fi -Status: Open +Status: ... -
#25116 [NEW]: PHP can't find session, it starts the new session
From: leo dot jokinen at laurea dot fi Operating system: Windows XP home PHP version: 4.3.2 PHP Bug Type: Session related... -
Kevin Marshall #2
Re: Session timeout: how to find out ?
>>What's your way of dealing with that problem (apart from declaring that
Whatever you do Don't try that :)>>the session should never expire...) ?
When working with Session variables or any other dynamic value it is always>>And what should I show the users? They of course should login again, but
>>how do I tell them?
advisable to check the values are not empty before attempting to use them,
especially when the data is destined for a database record.
something like:
If Session("Blah") <> "" Then
'Do the DB insert/update
Else
'Redirect to a page telling the user the session has expired
End If
its best not to blindly do a DB insert without first checking the data to be
inserted.
--
Kevin Marshall
WebXeL.com Ltd
[url]http://www.webxel.com[/url]
ASP.NET Dreamweaver Extensions
[url]http://www.webxel-dw.co.uk[/url]
"bthouin" <bernard_thouin@bluewin.ch> wrote in message
news:d1ei7a$ddu$1@forums.macromedia.com...> Hi,
>
> While I am developing my app (DW MX 2004, ASP, VBSCript, SQLServer), I hit
> again and again a session timeout, because I code for a long while before
> refreshing my page. I virtually always get a message like this:
>
> Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
> [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax
> near '='.
>
> This is because I use session variables quite a bit in my DB accesses.
>
> Now, how can I elegantly detect that the session has timed out so that my
> future users won't see this ugly message, if they access a page, then have
> their coffee break without exiting the page, and just refresh it when
> coming back?
>
> This can happen of course at many different places in my app, i.e.
> whenever I use a session variable. I don't really fancy putting checking
> code in each and every of my DB accesses for finding empty values of the
> access attributes...
>
> What's your way of dealing with that problem (apart from declaring that
> the session should never expire...) ?
>
> And what should I show the users? They of course should login again, but
> how do I tell them?
>
> Thanks for your advice.
>
> Bernard
Kevin Marshall Guest
-
Mintyman #3
Re: Session timeout: how to find out ?
You could specify the timout of the session variable to be whatever you like
so that it won't timeout as often. If it needs to be shorter when users are
accessing the system you could always do a site wide search and replace. Not
very elegant but it would work.
<% Session.timeout = 30 %>
Then make a reporting page that will tell you if they are still valid or not
(just an idea - not tested yet):
<% If Session("EXAMPLE") <> "" then %>
Session Example = <%=Session("EXAMPLE") %>
Do this for each session so that when you access this reporting page a list
of all current session variables will be displayed.
"bthouin" <bernard_thouin@bluewin.ch> wrote in message
news:d1ei7a$ddu$1@forums.macromedia.com...> Hi,
>
> While I am developing my app (DW MX 2004, ASP, VBSCript, SQLServer), I
> hit again and again a session timeout, because I code for a long while
> before refreshing my page. I virtually always get a message like this:
>
> Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
> [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax
> near '='.
>
> This is because I use session variables quite a bit in my DB accesses.
>
> Now, how can I elegantly detect that the session has timed out so that
> my future users won't see this ugly message, if they access a page, then
> have their coffee break without exiting the page, and just refresh it
> when coming back?
>
> This can happen of course at many different places in my app, i.e.
> whenever I use a session variable. I don't really fancy putting checking
> code in each and every of my DB accesses for finding empty values of the
> access attributes...
>
> What's your way of dealing with that problem (apart from declaring that
> the session should never expire...) ?
>
> And what should I show the users? They of course should login again, but
> how do I tell them?
>
> Thanks for your advice.
>
> Bernard
Mintyman Guest
-
Manuel Socarras #4
Re: Session timeout: how to find out ?
i must confess i really hate fullfilling the app with conditional
sentences to check if the sesion has timed out :-(
some time ago i was playing around with Session_OnEnd() but couldn't
find a reliable way to automatically detect session timeout. i can't
believe that can't be done!
Kevin Marshall wrote:
> When working with Session variables or any other dynamic value it is always
> advisable to check the values are not empty before attempting to use them,
> especially when the data is destined for a database record.
>
> something like:
> If Session("Blah") <> "" Then
> 'Do the DB insert/update
> Else
> 'Redirect to a page telling the user the session has expired
> End If
>
> its best not to blindly do a DB insert without first checking the data to be
> inserted.Manuel Socarras Guest
-
Kevin Marshall #5
Re: Session timeout: how to find out ?
Session_OnEnd() does work but it can't be used at page level, so there is no
way to for example redirect the user when the session times out, when a
session times out the server will simply create a new session and assign it
to the user when they requests another page.
The only reliable method I find is to check all values before blindly
attemting to use them.
--
Kevin Marshall
WebXeL.com Ltd
[url]http://www.webxel.com[/url]
ASP.NET Dreamweaver Extensions
[url]http://www.webxel-dw.co.uk[/url]
"Manuel Socarras" <msoc**no-spam**@airtel.net> wrote in message
news:d1epj2$p9v$1@forums.macromedia.com...>i must confess i really hate fullfilling the app with conditional sentences
>to check if the sesion has timed out :-(
>
> some time ago i was playing around with Session_OnEnd() but couldn't find
> a reliable way to automatically detect session timeout. i can't believe
> that can't be done!
>
> Kevin Marshall wrote:
>>> When working with Session variables or any other dynamic value it is
>> always advisable to check the values are not empty before attempting to
>> use them, especially when the data is destined for a database record.
>>
>> something like:
>> If Session("Blah") <> "" Then
>> 'Do the DB insert/update
>> Else
>> 'Redirect to a page telling the user the session has expired
>> End If
>>
>> its best not to blindly do a DB insert without first checking the data to
>> be inserted.
Kevin Marshall Guest
-
RobGT #6
Re: Session timeout: how to find out ?
For Session_OnEnd() information, check out the global.asa information
available on this forums archive at google, or on 4guys from rolla website
([url]http://www.4guysfromrolla.com[/url])
HTH
Rob
[url]http://robgt.com[/url]
RobGT Guest



Reply With Quote

