HI

I was wondering if anyone knew of a way to store a session state variable from a Query based on information in an access database

What i want to do is when the user logs in they supply their email address and password to log into site I want to store their CustomerID as a Session Variable to track them as they use the site, is this possible

Thanks

Yeah it is possible the best thing to do is connect to a database using the datareader potentially then read and compare fields until you find the one you want. Once you find the user you need add it to a Session variable.

If you are wanting to track where they have been and are entering it into the DB then you will need to on page load just do an insert into the DB of the current page they are on.

Not sure what you are wanting but that is the genearl idea how to do it. I usually don't ever use an access database so i can't help you with that.

When a user logs in i just get his/her details from the database and store the ones i need in a Session. eg..
(rs = my record set)

Session("ID") = rs("ID")
Session("login") = "true"
Session("type") = rs("membertype")

To track the users actions just do what percent20 said.

:)

dont you use the built in memebership providers? all the information is done for you. When a user is logged in and you need to know their information at any time just call Membership.GetUser() and it will return the current logged in user who made the request. It caches it too if you call it more than once in the page. Then you can use the profile provider too.
Much more powerful and easier to use than roll your own

This article has been dead for over six months. Start a new discussion instead.