Sessions
am 15.06.2006 18:00:01 von James Jones
few quik questions.....
i have sessions sesrt on my page to check for user ogins. if the session is
true, then they are logged in. would it be better to use cookies? i havnt
learned how to use those yet, but i can learn. (if thats best way, then
anyone provide me a link to a good tutorial for one?)
also, is it best to use an INCLUDE FILE to store all the variables that are
used each page...........or is there a better way to store variables for
each user on each page?
thank you for any help anyone can provide.
Re: Sessions
am 15.06.2006 19:05:38 von exjxw.hannivoort
James Jones wrote on 15 jun 2006 in microsoft.public.inetserver.asp.db:
> few quik questions.....
>
>
> i have sessions sesrt on my page to check for user ogins. if the
> session is true, then they are logged in. would it be better to use
> cookies? i havnt learned how to use those yet, but i can learn. (if
> thats best way, then anyone provide me a link to a good tutorial for
> one?)
>
>
> also, is it best to use an INCLUDE FILE to store all the variables
> that are used each page...........or is there a better way to store
> variables for each user on each page?
This is far to quick a question for me, please ask slowly, James.
Tell us what is a sesrt?
And what are ogins.
How can the session be true?
Do you mean a specific session variable having a value true?
The best way is always a matter of opinion and taste,
and what you are trying o accomplish,
[which you did not tell]
so no one can answer that for you.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Re: Sessions
am 15.06.2006 19:16:18 von James Jones
im sry those were typos........
sesrt = set
ogins = logins
yes the variable is true in the session
im just wanting users to login, and need to know the best way to save their
login information. if sessions are used, then they are closed when the
browser is closed.....i really dont want that....................i would
like the user to be able to stay logged in while they are off the page, for
a certain amount of time
"Evertjan." wrote in message
news:Xns97E3C23EDB03eejj99@194.109.133.242...
> James Jones wrote on 15 jun 2006 in microsoft.public.inetserver.asp.db:
>
>> few quik questions.....
>>
>>
>> i have sessions sesrt on my page to check for user ogins. if the
>> session is true, then they are logged in. would it be better to use
>> cookies? i havnt learned how to use those yet, but i can learn. (if
>> thats best way, then anyone provide me a link to a good tutorial for
>> one?)
>>
>>
>> also, is it best to use an INCLUDE FILE to store all the variables
>> that are used each page...........or is there a better way to store
>> variables for each user on each page?
>
> This is far to quick a question for me, please ask slowly, James.
>
> Tell us what is a sesrt?
> And what are ogins.
>
> How can the session be true?
> Do you mean a specific session variable having a value true?
>
> The best way is always a matter of opinion and taste,
> and what you are trying o accomplish,
> [which you did not tell]
> so no one can answer that for you.
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)
Re: Sessions
am 15.06.2006 20:29:26 von exjxw.hannivoort
James Jones wrote on 15 jun 2006 in microsoft.public.inetserver.asp.db:
> "Evertjan." wrote in message
> news:Xns97E3C23EDB03eejj99@194.109.133.242...
>> James Jones wrote on 15 jun 2006 in
>> microsoft.public.inetserver.asp.db:
>>
>>> few quik questions.....
>>>
>>>
>>> i have sessions sesrt on my page to check for user ogins. if the
>>> session is true, then they are logged in. would it be better to use
>>> cookies? i havnt learned how to use those yet, but i can learn. (if
>>> thats best way, then anyone provide me a link to a good tutorial for
>>> one?)
>>>
>>>
>>> also, is it best to use an INCLUDE FILE to store all the variables
>>> that are used each page...........or is there a better way to store
>>> variables for each user on each page?
>>
>> This is far to quick a question for me, please ask slowly, James.
>>
>> Tell us what is a sesrt?
>> And what are ogins.
>>
>> How can the session be true?
>> Do you mean a specific session variable having a value true?
>>
>> The best way is always a matter of opinion and taste,
>> and what you are trying o accomplish,
>> [which you did not tell]
>> so no one can answer that for you.
[please do not toppost on usenet]
> im sry those were typos........
> sesrt = set
> ogins = logins
> yes the variable is true in the session
That is not the same.
A session variable is a serverside variable that can be used all over the
session and while in session:
<%
session("mySessionVariable") = true
%>
> im just wanting users to login, and need to know the best way to save
> their login information.
There is no "best" way, and there are many good ways.
> if sessions are used, then they are closed
> when the browser is closed.....i really dont want
> that..
> ...i would like the user to be able to stay
> logged in while they are off the page, for a certain amount of time
Impossible because that is not the definition of "logged in"
However, you can use a cookie in stead of a session variable.
try:
<%
response.cookies("myCookie") = true
response.cookies("myCookie").expires = Date + 365
%>
and
<%
if requesst.cookies("myCookie") then
response.write "Yes!"
end if
%>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Re: Sessions
am 16.06.2006 00:55:44 von Bob Lehmann
>> and what you are trying o accomplish,
What is 'o' ?
Don't you just hate that ? :>)
Bob Lehmann
"Evertjan." wrote in message
news:Xns97E3C23EDB03eejj99@194.109.133.242...
> James Jones wrote on 15 jun 2006 in microsoft.public.inetserver.asp.db:
>
> > few quik questions.....
> >
> >
> > i have sessions sesrt on my page to check for user ogins. if the
> > session is true, then they are logged in. would it be better to use
> > cookies? i havnt learned how to use those yet, but i can learn. (if
> > thats best way, then anyone provide me a link to a good tutorial for
> > one?)
> >
> >
> > also, is it best to use an INCLUDE FILE to store all the variables
> > that are used each page...........or is there a better way to store
> > variables for each user on each page?
>
> This is far to quick a question for me, please ask slowly, James.
>
> Tell us what is a sesrt?
> And what are ogins.
>
> How can the session be true?
> Do you mean a specific session variable having a value true?
>
> The best way is always a matter of opinion and taste,
> and what you are trying o accomplish,
> [which you did not tell]
> so no one can answer that for you.
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)
Re: Sessions
am 16.06.2006 03:51:29 von James Jones
im just want to find the best way to log a user in, and have the user stay
logged in for more than 20mins of inactivity. and the best way to store
variables for the user........i like sessions, but im not sure if there is a
easier way.
"Bob Lehmann" wrote in message
news:%23tlp15MkGHA.3536@TK2MSFTNGP05.phx.gbl...
>>> and what you are trying o accomplish,
> What is 'o' ?
>
> Don't you just hate that ? :>)
>
> Bob Lehmann
>
>
> "Evertjan." wrote in message
> news:Xns97E3C23EDB03eejj99@194.109.133.242...
>> James Jones wrote on 15 jun 2006 in microsoft.public.inetserver.asp.db:
>>
>> > few quik questions.....
>> >
>> >
>> > i have sessions sesrt on my page to check for user ogins. if the
>> > session is true, then they are logged in. would it be better to use
>> > cookies? i havnt learned how to use those yet, but i can learn. (if
>> > thats best way, then anyone provide me a link to a good tutorial for
>> > one?)
>> >
>> >
>> > also, is it best to use an INCLUDE FILE to store all the variables
>> > that are used each page...........or is there a better way to store
>> > variables for each user on each page?
>>
>> This is far to quick a question for me, please ask slowly, James.
>>
>> Tell us what is a sesrt?
>> And what are ogins.
>>
>> How can the session be true?
>> Do you mean a specific session variable having a value true?
>>
>> The best way is always a matter of opinion and taste,
>> and what you are trying o accomplish,
>> [which you did not tell]
>> so no one can answer that for you.
>>
>> --
>> Evertjan.
>> The Netherlands.
>> (Please change the x'es to dots in my emailaddress)
>
>
Re: Sessions
am 16.06.2006 09:36:09 von exjxw.hannivoort
Bob Lehmann wrote on 16 jun 2006 in microsoft.public.inetserver.asp.db:
>>> and what you are trying o accomplish,
> What is 'o' ?
Eiher my fingers are geing shorer,
or he keyboard key "" is no reacing
as i should.
> Don't you just hate that ? :>)
Yes, I hae when i does ha, Bob!
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Re: Sessions
am 16.06.2006 09:38:09 von exjxw.hannivoort
James Jones wrote on 16 jun 2006 in microsoft.public.inetserver.asp.db:
> im just want to find the best way to log a user in, and have the user
> stay logged in for more than 20mins of inactivity. and the best way to
> store variables for the user........i like sessions, but im not sure
> if there is a easier way.
>
The session timeout can be changed by your code.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Re: Sessions
am 17.06.2006 02:32:34 von James Jones
o yea, i forgot that is possible...........
..how would i be able to detect if a user is activley browsing?
"Evertjan." wrote in message
news:Xns97E46208D7513eejj99@194.109.133.242...
> James Jones wrote on 16 jun 2006 in microsoft.public.inetserver.asp.db:
>
>> im just want to find the best way to log a user in, and have the user
>> stay logged in for more than 20mins of inactivity. and the best way to
>> store variables for the user........i like sessions, but im not sure
>> if there is a easier way.
>>
>
> The session timeout can be changed by your code.
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)
Re: Sessions
am 17.06.2006 09:52:17 von exjxw.hannivoort
James Jones wrote on 17 jun 2006 in microsoft.public.inetserver.asp.db:
> "Evertjan." wrote in message
> news:Xns97E46208D7513eejj99@194.109.133.242...
>> James Jones wrote on 16 jun 2006 in microsoft.public.inetserver.asp.db:
>>
>>> im just want to find the best way to log a user in, and have the user
>>> stay logged in for more than 20mins of inactivity. and the best way to
>>> store variables for the user........i like sessions, but im not sure
>>> if there is a easier way.
>>>
>>
>> The session timeout can be changed by your code.
[please do not toppost on usenet]
> o yea, i forgot that is possible...........
>
> .how would i be able to detect if a user is activley browsing?
Do you mean, if a page is requested?
Isn't that self evident?
You could put this in each page:
<%
if session("accessed")<>"" then
response.write "Last access in this session on: " & session("accessed")
end if
session("accessed") = now()
%>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Re: Sessions
am 17.06.2006 11:12:46 von Mike Brind
James Jones wrote:
> few quik questions.....
>
>
> i have sessions sesrt on my page to check for user ogins. if the session is
> true, then they are logged in. would it be better to use cookies? i havnt
> learned how to use those yet, but i can learn. (if thats best way, then
> anyone provide me a link to a good tutorial for one?)
'Setting the value of a cookie
Response.Cookies("MyCookie") = "value"
'Setting the values of cookie keys
Response.Cookies("MyCookie")("MyKey") = "value"
Response.Cookies("MyCookie")("MyOtherKey") = "anothervalue"
'Setting the expiration to 30 days from now
Response.Cookies("MyCookie").Expires = Date + 30
'Reading the value of a cookie
Response.Write Request.Cookies("MyCookie")
'Reading the value of a cookie key
Response.Write Request.Cookies("MyCookie")("MyKey")
'Deleting a cookie
Response.Cookies("MyCookie").Expires = Date-1
>
>
> also, is it best to use an INCLUDE FILE to store all the variables that are
> used each page...........or is there a better way to store variables for
> each user on each page?
>
>
What kind of variables? How long do they persist? Are they relevant
to other pages?
--
Mike Brind
Re: Sessions
am 17.06.2006 15:24:38 von James Jones
the variables are information about the user that are used anytime the user
loads a page..............i was told the sessions take a lot of server
resources. so would i be best to use cookies?
"Mike Brind" wrote in message
news:1150535566.050620.160440@u72g2000cwu.googlegroups.com.. .
>
> James Jones wrote:
>> few quik questions.....
>>
>>
>> i have sessions sesrt on my page to check for user ogins. if the session
>> is
>> true, then they are logged in. would it be better to use cookies? i havnt
>> learned how to use those yet, but i can learn. (if thats best way, then
>> anyone provide me a link to a good tutorial for one?)
>
>
> 'Setting the value of a cookie
> Response.Cookies("MyCookie") = "value"
>
> 'Setting the values of cookie keys
> Response.Cookies("MyCookie")("MyKey") = "value"
> Response.Cookies("MyCookie")("MyOtherKey") = "anothervalue"
>
> 'Setting the expiration to 30 days from now
> Response.Cookies("MyCookie").Expires = Date + 30
>
> 'Reading the value of a cookie
> Response.Write Request.Cookies("MyCookie")
>
> 'Reading the value of a cookie key
> Response.Write Request.Cookies("MyCookie")("MyKey")
>
> 'Deleting a cookie
> Response.Cookies("MyCookie").Expires = Date-1
>
>
>>
>>
>> also, is it best to use an INCLUDE FILE to store all the variables that
>> are
>> used each page...........or is there a better way to store variables for
>> each user on each page?
>>
>>
>
> What kind of variables? How long do they persist? Are they relevant
> to other pages?
>
> --
> Mike Brind
>
Re: Sessions
am 17.06.2006 15:37:11 von reb01501
James Jones wrote:
> the variables are information about the user that are used anytime
> the user loads a page..............i was told the sessions take a lot
> of server resources. so would i be best to use cookies?
>
He did not ask about the data stored in the variables. He asked about the
types of variables you are using: are you storing strictly numbers? strings?
arrays? COM objects?
"a lot" is extremely vague. I use session variables all the time to store
small bits of information about the session: strings and numbers.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Re: Sessions
am 17.06.2006 15:49:51 von James Jones
o ok.....
they will be strings.............
"Bob Barrows [MVP]" wrote in message
news:uiXtjMhkGHA.1264@TK2MSFTNGP05.phx.gbl...
> James Jones wrote:
>> the variables are information about the user that are used anytime
>> the user loads a page..............i was told the sessions take a lot
>> of server resources. so would i be best to use cookies?
>>
> He did not ask about the data stored in the variables. He asked about the
> types of variables you are using: are you storing strictly numbers?
> strings? arrays? COM objects?
>
> "a lot" is extremely vague. I use session variables all the time to store
> small bits of information about the session: strings and numbers.
>
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
Re: Sessions
am 17.06.2006 15:57:25 von reb01501
In that case, you are probably better off worrying about some other part of
your application.
James Jones wrote:
> o ok.....
>
> they will be strings.............
>
>
>
>
>
> "Bob Barrows [MVP]" wrote in message
> news:uiXtjMhkGHA.1264@TK2MSFTNGP05.phx.gbl...
>> James Jones wrote:
>>> the variables are information about the user that are used anytime
>>> the user loads a page..............i was told the sessions take a
>>> lot of server resources. so would i be best to use cookies?
>>>
>> He did not ask about the data stored in the variables. He asked
>> about the types of variables you are using: are you storing strictly
>> numbers? strings? arrays? COM objects?
>>
>> "a lot" is extremely vague. I use session variables all the time to
>> store small bits of information about the session: strings and
>> numbers.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Re: Sessions
am 17.06.2006 16:02:01 von James Jones
ok thanks a lot everyone!
"Bob Barrows [MVP]" wrote in message
news:%23qPs3XhkGHA.1264@TK2MSFTNGP05.phx.gbl...
> In that case, you are probably better off worrying about some other part
> of your application.
>
> James Jones wrote:
>> o ok.....
>>
>> they will be strings.............
>>
>>
>>
>>
>>
>> "Bob Barrows [MVP]" wrote in message
>> news:uiXtjMhkGHA.1264@TK2MSFTNGP05.phx.gbl...
>>> James Jones wrote:
>>>> the variables are information about the user that are used anytime
>>>> the user loads a page..............i was told the sessions take a
>>>> lot of server resources. so would i be best to use cookies?
>>>>
>>> He did not ask about the data stored in the variables. He asked
>>> about the types of variables you are using: are you storing strictly
>>> numbers? strings? arrays? COM objects?
>>>
>>> "a lot" is extremely vague. I use session variables all the time to
>>> store small bits of information about the session: strings and
>>> numbers.
>
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>