 |
| Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

June 9th, 2004, 01:59 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi Dan,
The idea is that you store Session("LoggedIn") = True immediately on the page where they log in. E.g.:
Code:
[Login.asp]
' Check User name and password here
If ValidUser Then
Session("LoggedIn") = True
Response.Redirect("passsuccess.asp")
Else
' Invalid user
End If
Indeed it seems your problem is caused by the fact that the information is not yet available, and not because it's no longer available:
Quote:
|
quote:This script is ideal for when people do time out for hanging around inactive, but for the members who are requesting data before it is sent (i.e. the people affected by my problem) will they not go round in circles?..
|
This brings me back to an earlier question: What's the point of storing WHERE clauses in session variables?
Are you storing the WHERE clause to remember people's filter settings? If that's the case, can't you just simply set a default value in case their personalized value is missing??
Code:
If Session("ref") <> "" Then
update__str = Session("ref")
Else
update__str = "Whatever your default should be"
End If
It would help if you'd elaborate a bit about the purpose of the application. Explain why you are storing ref in a Session, and what you're using it for.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

June 9th, 2004, 06:05 AM
|
|
Registered User
|
|
Join Date: Jun 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Imar,
thanks for your patience!!!
Basically the small element of script in question was found on another ASP free script site. uptime-str and update-str are simply aimed at recording todays date and time of a members login.... thats all!!:D
The date and time are recorded in the database. It makes no difference what the old value is (either 0 for new user or a past date and time of entry to the site) because there is no chance of that visit being more recent than the new one! The row which this new date and time is added to is defined by the username, password entered in the login page (page before this).... this is related to a 'reference' number another field in the database to identify members.
Like i said it works fine for everyone but a select few.... WHY?? what could cause a script to fail on some systems and not others?
cheers.
|
|

June 9th, 2004, 12:23 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
If it works for some, and not for others right after they log in, I would check their firewall or security software or the settings in their browser.
ASP Sessions depend on the availability of cookies (as the ASP Session ID is stored in a cookie). If the client doesn't support cookies (e.g. turned off, intercepted by security software) each new page request will result in a new Session object, so Session("Ref") will never get a decent value.
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

June 10th, 2004, 05:42 AM
|
|
Registered User
|
|
Join Date: Jun 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Imar,
Thanks sooooo much for taking the time to help me..... i really appreciate it. What i am going to do is put the script you gave me into the program that will redirect people back to the re-login page (as if it were a time-out) here i can give instructions to members to maybe disable their firewall or reduce security settings to allow cookies.
i think this may be the winning solution!!!
Is it best to just direct them toward tools>internet options>custom level....... Then where? i cannot seem to find the 'enable cookies' promt  ???
Is there normally a similar promt to enable cookies for firewalls?
|
|

June 10th, 2004, 06:05 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
There is a Privacy tab on the Internet Options dialog that deals with cookies (click the Edit button).
For firewalls it's a different story. There are many different programs each dealing with it in a different way. I wouldn't dare trying to describe a general action plan for people to turn on cookies.
I would try to set a cookie, and if it fails, indeed tell your users their browsers need to support cookies.
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

June 10th, 2004, 08:17 AM
|
|
Registered User
|
|
Join Date: Jun 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
IMAR, IMAR, IMAR.... AN ABSOLUTE LEGEND!!!
Sorry to be such a pest, but you really do seem to have ALL the answers!!
All i need now is one small thing... please :D
Can you recommend a script that allows a quick cookie test and then directs to a page i can post the 'need for active cookies' warning?? i'll love you forever!!;)
Cheers ever so ever so much!!
Dan (ever Indebted)
|
|

June 10th, 2004, 08:53 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Try this:
http://www.4guysfromrolla.com/webtech/082400-1.shtml
You can also send a cookie Server Side
Response.Cookies("Bla") = "Blablabla"
and then send out a *client side* redirect
Response.Write("<scr" & "ipt>location.href='SecondPage.asp';</scr" & "ipt>")
and then on SecondPage.asp you can check whether the cookie exists or not:
If Len(Request.Cookies("Bla") & "") = 0 Then
' Cookie not found.
End If
Does this help?
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

June 10th, 2004, 09:49 AM
|
|
Registered User
|
|
Join Date: Jun 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Imar,
no worries.... the script you already gave me is perfect!... i simply use it as if for a timeout and display my cookie message on it.
You are a Star... couldn't have done it without you.
Good luck to Holland in the Euro 2004 champtionships!
Thanks:D
|
|

June 10th, 2004, 11:15 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Ha, thanks. I am afraid we definitely need all the luck we can get. Things don't look too promising.
Good luck for England too ;)
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|
 |