Sessions & Cookies
I want to do something very simpel. Make a part of my website available
only for users with a username and password. The site is mainly ASP
based. The webserver is an IIS6 and I do NOT have access to server
settings (session timeout, security,...).
I use sessions to set the validation for the users. Basically you are
redirected to a form where you can give a username and password, this is
validated with the values in a database. If the password and username
are ok a session value is set <%=Session("Validated")=True%>*.
At the beginning of each secured page I start with:
<%If Session("Validated")=False Then Response.Redirect("Login.asp") End
If%>
So if the session value "validated" is true you can see the secured
pages, else you are redirected to the logon page.
The default timeout value for session is 20 minutes. Because the session
should stay alive during the complete time of the visit I was thinking
of puting the session.timeout to 60 minutes. I set this at the beginning
of every secure page: <%Session.timeout=60%>
Now, Users keep on contacting me saying that they have to relogon quiet
often. This also seems to happen when a user is not on the website for
20 minutes already (session expired). I tested it myself and have the
feeling the I am indeed regularly redirected. Sometimes after 10
minutes, other times 30 minutes, ... There seems not to be any logic in
the time that users are redirected to the logon page.
Because the website is used to fill in a lot of long HTML forms, it is
very frustrating for the users when they are completing a form and then
pressing "Submit" being redirected to the logon page and lose all
entered data.
Is there somebody who can give me more info on the strange session
behavior? For me it is not normal that a session times out in that
unlogic way.
The only solution I can think of is passing the post information to the
logon page and then redirect after validation back to the transaction
page.
How can you reset the timeout counter on a session in ASP? What I was
thinking was that I am doing it maybe wrong?
Now the session variable that let a user have access to the site is set
once at logon time: (<%=Session("Validated")=True%*>*). Then it is
checked on every page that the user opens (<%If
Session("Validated")=False Then Response.Redirect("Login.asp") End If%>)
Would it be a good idea to re-set the variable every time a user
accesses page? Like <%If Session("Validated")=False Then
Response.Redirect("Login.asp") Else Session("Validated")=True End If%>
Would this reset the timer that times out the session? Or do I have to
add something like <%Session.Abandon%> before setting the variable
again?
What would this do on the server performance?
Is this a good way of working with sessions?
Swicth to cookies i.o. sessions?
I am open for all suggestions, please help! In the future there are also
money transactions going over this website, so it has to be a secure
method! I will use a seperate HTTPS host for this.
View Replies
ADVERTISEMENT
Using Session("variableName") to store data for the duration of a session. And using Response.Cookie("nameOfCookie") to store data as a "cookie" in ASP.....some questions here....
Session Variables. There's no disabling that CLIENT-SIDE is there? ASP Sessions are managed by the server, so as long as it's running fine, there's nothing the client can do to stop session variables from being created right?
"Session" Cookies? When using Response.Cookie, is that data actually written to the client's HDD like Javascript cookies would be? I noticed in MSIE 6 you can goto TOOL > INTERNET OPTIONS > PRIVACY > ADVANCED and Overide Session Cookie settings, but they don't seem to work.
I UNCHCKED to ALWAYS ALLOW SESSION COOKIES, and then did a
Code: ....
View Replies
View Related
i'm creating a shopping cart and i need to know when users add products to their shopping cart, does it load a session for each visitor, which when a new customer tries to add it opens a session for him and he closes the site the session closes enabling another visitor to start with an empty basket ?
or does it use cookies instead of sessions ?
my shopping cart does not work properly...
i need to fix it in this way, when a new visitor tries to add products to the shopping cart it doesn't display the previous products of the previous visitor.
noting that i'm not using any registration as yet......
how can i fix that?
i have a file called shop.asp which list the type of products available in the database and then when a type is clicked a list of products under this type will be displayed, then customers can add to the cart whatever they want.....
but this does not work properly because if another user tries to access the cart he'll see the previous products in there....
View Replies
View Related
I have a button that takes me back to my login screen but the user can press back and get back in. I have done some research and looked around and the only way i have found is using sessions-by creating and loosing sessions.
I however use neither and pass my username via a textbox.
Is there a simple way to somehow logout securely without allowing the user to enter the back button?
View Replies
View Related
UserA has a PC running IE 6. This has the cookies disabled:
1 - Override automatic cookie handling: checked
2 - First party cookies: Block
3 - Third-party cookies: Block
4 - Always allow session cookies: Unchecked
The server runs a Classic ASP application running in IIS 5.x that uses the
session cache. These are different machines running within a LAN.
When UserA accesses the website, the ASP code retrieves some data from the
DB and puts it into the session cache and timestamps it (to give it a
time-to-live value).
When UserA accesses the site again, the ASP code checks the value of
Session("DatabaseSettings_DateAccessed") to see if the cache has expired.
Bizarrely, it picks up the correct date set on the previous visit.
I would have expected that, since UserA does not have session cookies
enabled, there should be no existing session identifier available for UserA.
So, how is IIS recognising UserA's session?
View Replies
View Related
Customer wants users to authenticate based on where they came from. They have several locations that the users will be coming from. They don't want anyone to be able to access their website from anywhere other than these locations. The locations ip addresses will be changing regularly. Is there a way to have a page on the INTRANET internally that the users will go to and it will start a session or place a cookie and pass them to the website. The website then looks for that session or cookie and lets them in or denies them based on the session or cookie. The sites that they will be coming from are ASP and .NET servers and it encrypts the URL that it is coming from. The website it is going to is on a PHP server and is built on PHP and MySQL. I have asked this in like every forum on the internet I can find and no one seems to have a solution.
View Replies
View Related
Its strange...I have experimenting with browser hawk by using the cookie sniffer method. However, even If adjust the security slider level in internet options or goto advanced in the privacy tab I cannot seem to prove the condition below....it is almost as if cookies don't want to die in my testing environment.
I did try closing the browser and relaunching but cookies and session ids seem alive and well....is this the usual hassle with testing cookies/sessions?
Option Explicit
Dim bh
set bh = Server.CreateObject("cyScape.browserObj")
bh.SetExtProperties "cookie_both"
bh.GetExtPropertiesEx
if not bh.cookiesEnabled then
response.write "COOKIES DEAD"
end if
View Replies
View Related
Is it possible to send form values from PAGE1 to PAGE2, and then retain the
form info for PAGE3 without using cookies, sessions or DB storage? Also, I
dont want to repost page2 to page3 using hidden form fields.
Just curious! Want to know how to "simply" maintain user form inputs across
a web site even when security and privacy controls are set to MAXIMUM on the
browser. I know using databases would do it, but I would love to find a
simpler solution.
View Replies
View Related
As I understand it IE stores the session id in a cookie on the user machine.
This identifies the session between pages.
If cookies are disabled then session variables don't work...
Is it possible to pass the session id between pages by posting them etc, and
manually force the session id on each page.
View Replies
View Related
Any body know of a resource that compares/benchmarks the expense (in terms of milli seconds, or server load) of using various programing options?
I know a lot of articles and forum posts reccomend best practices between functions and programming options, but I would be interested in some type of definitive benchmark to decide between various prgramming options, depending on the need.
For example, I can call a Recordset and quickly write it into an array, so that the connection can be closed even before I write the data to the HTML page. This would save conection time and server resources, but I'd like to be able to judge the worth when considering coding it.
Every time I do a Server.Transfer how expensive is it to the server? How much am I loading the server with Session varaibles? If I store some info in a cookie, but have to call it, how long will that take? Am I using up server resources by creating large arrays?
View Replies
View Related
In my Session_OnStart in Global.asa, I am setting some cookies. One
of them, I set as follows:
dim UserID
UserID = Request.ServerVariables("LOGON_USER")
Response.Cookies("User")("ID") = UCASE(UserID)
When I immediately log the cookie value retrieved from
Request.Cookies("User")("ID") into the Windows Event Log, I get the
correct value. However, when I try to retrieve the cookie on the home
page of my application using the same code,
Request.Cookies("User")("ID"), it either cannot find the cookie or
cannot read the value. I am retrieving the cookie before all HTML
headers are written. It is my first statement on the page after
Option Explicit. I have even compared the session IDs. The SessionID
created in the Session_OnStart is the same value as the SessionID on
the home page.
I have read that the Session_OnStart only has access to the
Application, Session and Request objects. It does not explicitly say
that it does not have access to the Response object. Also, I was even
able to use Response.Write's in Global.asa to print out the values
although it looked like it had also stopped the session after I did
so. Cookies are definitely enabled on my machine. I have even tried
setting the session cookie's expiration to be persistent for a few
days to see if it was perhaps expiring before I was able to read it
but this did not work either.
Is there something preventing cookies to be created in Global.asa in
the Session_OnStart sub? Is the Response object not available???
Please let me know if anyone else has had this problem or solution.
View Replies
View Related
Is it possible for a user to enable permanent cookies but disable session cookies.....this seems like a contradition yet this is what I appear to be
reading in online articles?
View Replies
View Related
I m creating a cookies in my application and it work properly but i can't see the cookies where it will sotred i checked the cookies folder but i didn't find that I want to create a cookies file as the other web site create and store where other cookies will stored in Cookies folder or Temprory Internet files folder eg:1. arvind@google.co[1].txt this stored in cookies folder 2. arvind@msn[2].txt ....
View Replies
View Related
We are planning to set-up a load balanced web environment. Accordingly, we are going to change the session management on our website from the classic ASP Session State and session variables, to a database method.
Does any one have any pointers as to how I might approach this, so that I can have the same sort of functionality the ASP sessions give without having to create database columns for each session variable I wish to create. I am thinking along the lines of some serialised dictionary or something that I can stick in a blob column.
View Replies
View Related
Can someone explain to me how you set a session and how you check the session?
View Replies
View Related
I created a session variable in an asp page as below:
Session("userid") = userid
is it possible for me to read that same variable "userid" in a seperate perl script? if so how?
View Replies
View Related
I have session time by default as 20 mints in iis.
I want to that to be increased by 60 mints in my application so that when user save changes after 21st mint the session should not be lost.
Can this be happen without changing the default time in iis since i have many other applications.
View Replies
View Related
Any one know how to end all the session in asp application. Is there any other directive rather than '#include' to include a file in our Asp page.
View Replies
View Related
I was wanting to know if you could have a function within a session?Example:
Code:
<% Session("Message") = MyFunction() %>
Is that possible? Ok, maybe not "is it possible" but can you use the session message to dictate where the function outputs its data? Here's why I'm asking. I have an online testing app that when a person selects the wrong answer the correct answer (along with a bunch of other stuff) will be displayed on the page.
I'm getting it to display the correct answer and the other information, but the correct answer is at the top of the page screwing up my layout and the other information is doing what it should.
View Replies
View Related
I am using an HTTPS connection and posting to an asp page that does a
redirect based on if the user is authenticated.
However, for some reason after the session is set and the user redirect
the session dies and the user logged out?
Any ideas?
The redirect looks like Response.Redirect "../welcome.asp".
View Replies
View Related
I am using ServerXmlHttp in a client-side component to basically talk back to the Server within a webpage. I would like to be able to cache some information on the server so that when I callback, I do not have to reconstitue everything that I did for the intial request. However, the Sessions are different.
Is there a way to get the ServerXmlHttp session to impersonate the IE client session? Code:
View Replies
View Related
can any one tell me how to use sessions in asp for 2different users please?Is it straight forward? Never used them before, a friend said it is worth doing
View Replies
View Related
I'm trying to use a couple of Session variables within SSL.
My form submits to the same page and this is at the top of the page.
<%
Session("ShipAhead") = Request.Form("ShipAhead")
Session("Comments") = Request.Form("Comments")
%>
The form fields are populated but the Sessions are empty on my next page.
Am I missing something? Is there a problem with Sessions and SSL?
View Replies
View Related
I've just created a simple form that writes information to an
Access database using ASP. Everything works fine. My question is, would
there be any reason to use the session object other than for tracking
purposes.
Specifically, does a session have any inportance on multiple
users accessing pages and submitting the form inforamtion to the database.
I was curious about errors to the database with multiple users submitting at
the same time to the database. This is a small scale application and not
expected to have large number of hits. As stated I'm new to using ASP and
just wanted to get some input.
View Replies
View Related
I have used SESSIONS on mission critical pages on my site, and if sessions are not enabled / supoorted - these pages will fail. When and why would a session fail? They do not store any info client side,and rely on the server to store session objects in memory, am I correct? Would security settings or privacy controls ever stop sessions working? Which "popular" browsers dont support sessions?
View Replies
View Related
Are sessions stored on the server or the visitors PC?
View Replies
View Related
I don't know how to do anything with session and I don't need anything complicated at all. All i need it to do is like create a session when they login sucessfully. And like I want to add on every page if they don't have a session id and the correct access priveleges or watever to redirect them to the login page.how would i do that?
View Replies
View Related
I've had a look around the site but can't find exactly what i'm looking for.I'm writing a small ticket booking engine in asp and am wondering about sessions.Do I need them ? and what is involved in adding them to my code?
View Replies
View Related
I am trying to set a session with a few variables so i can retrieve them and use them to display results on another page so far my code is
This is for setting the session
Session["Name"] = "shiodsgj";
Session["MaxPrice"] = "nkfskgjk";
Retrieving the session
user.Text = (String)Session["User"];
MaxPrice.Text = (String)Session["Network"];
Do i need to create a session if so how, I understand that session.add(string, object) does this but i am recieving errors whilst doing this.
View Replies
View Related
a user logs into a website (im using acess for the database, asp for the pages), they are then in a members only area. They should have the ability to view their own personal details and change them if they wish. this should be updated in the database.
the problem is im not sure how to go about it. i seen sessions mentioned in tutorials but im still ,well, lost basically.
View Replies
View Related
I've got two different sets of ASP scripts on my server. Each set is kept in their own directory. Both sets of scripts use sessions. I want to make sure that the sessions are not accidentially shared between the two sets as they are both different applications.
Right now I'm having a problem when I do a Session.Abandon from one set of scripts it also kills the session for the other set of scripts (I believe they are both using the exact same session). Is there some way I can make sure this doesn't happen?
View Replies
View Related
is there a way that i can use both php and asp on my site. So that i can switch over a session to a new php admin page?
View Replies
View Related
Has anyone had any problems using sessions with XP? Are there any tricks to getting it to work properly?
View Replies
View Related