473,804 Members | 3,478 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Session objects and POSTed Form items

Hi all,

Anyone know of any issues with setting the value of a Session object
to the value of a submitted form item via
'Session("mySes sionObj")=Reque st.Form("myFrmE lem")' ?

In my case the Session object gets set fine. But when the user links
to another page, the value of the session object is EMPTY.

thanks in advance..

-BB
Jul 19 '05 #1
9 2408
Brian Burgess wrote on 30 aug 2003 in
microsoft.publi c.inetserver.as p.general:
Anyone know of any issues with setting the value of a Session object
to the value of a submitted form item via
'Session("mySes sionObj")=Reque st.Form("myFrmE lem")' ?
This is not "the session object", it is just a variable stored on the
server for use by all asp pages during that session.

"The session object" is the collection of all these variables.
In my case the Session object gets set fine.
See above.
But when the user links to another page,
the value of the session object is EMPTY.


If that page is not in the same session, yes, otherwise it is available.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #2
Well I tried two ways...
1st:
If (Session("login ") = Empty) Then
Session("login" ) = Request.Form("l ogin")
End If

2nd:
If (Session("login ") = "") Then
Session("login" ) = Request.Form("l ogin")
End If
I should also mention that the user could be transfered to this page
from some other pages .. in this case we would not have the
'Request.Form(" login")' available to us. HOWEVER, in this case we
should have already been through the login process, and therefore the
Session collection item(login) should already be set.

Got it? :-)
Thnks again,

-BB
On 30 Aug 2003 12:56:19 GMT, "Evertjan."
<ex************ **@interxnl.net > wrote:
Brian Burgess wrote on 30 aug 2003 in
microsoft.publ ic.inetserver.a sp.general:
It IS in the same session! .. the user is linking .. in fact this all
WAS working .. until I changed the code to only set the value of a
Session collection item IF that item did not already have a value.


I think we would need to see that piece of code.


Jul 19 '05 #3
looks like a logical flaw

on your login page, it would be better to use this

If Request.Form("l ogin") <> "" then
Session("login" ) = true
End if

if the user comes from another page having already logged in, to check

if session("login" ) <> true then

else

end if

jason

"Brian Burgess" <bb********@hot mail.com> wrote in message
news:k1******** *************** *********@4ax.c om...
Well I tried two ways...
1st:
If (Session("login ") = Empty) Then
Session("login" ) = Request.Form("l ogin")
End If

2nd:
If (Session("login ") = "") Then
Session("login" ) = Request.Form("l ogin")
End If
I should also mention that the user could be transfered to this page
from some other pages .. in this case we would not have the
'Request.Form(" login")' available to us. HOWEVER, in this case we
should have already been through the login process, and therefore the
Session collection item(login) should already be set.

Got it? :-)
Thnks again,

-BB
On 30 Aug 2003 12:56:19 GMT, "Evertjan."
<ex************ **@interxnl.net > wrote:
Brian Burgess wrote on 30 aug 2003 in
microsoft.publ ic.inetserver.a sp.general:
It IS in the same session! .. the user is linking .. in fact this all
WAS working .. until I changed the code to only set the value of a
Session collection item IF that item did not already have a value.


I think we would need to see that piece of code.

Jul 19 '05 #4
Cool!

That might work better to check if the user had logged in. But I
also need the actual lgoin value in some of the pages. Do you think
that the following would work then?
If Request.Form("l ogin") <> "" Then
Session("login" ) = Request.Form("l ogin")
End if

Thanks

-BB
On Sat, 30 Aug 2003 14:31:35 +0100, "jason kennedy" <ja***@pinhut.c om>
wrote:
looks like a logical flaw

on your login page, it would be better to use this

If Request.Form("l ogin") <> "" then
Session("login ") = true
End if

if the user comes from another page having already logged in, to check

if session("login" ) <> true then

else

end if

jason

"Brian Burgess" <bb********@hot mail.com> wrote in message
news:k1******* *************** **********@4ax. com...
Well I tried two ways...
1st:
If (Session("login ") = Empty) Then
Session("login" ) = Request.Form("l ogin")
End If

2nd:
If (Session("login ") = "") Then
Session("login" ) = Request.Form("l ogin")
End If
I should also mention that the user could be transfered to this page
from some other pages .. in this case we would not have the
'Request.Form(" login")' available to us. HOWEVER, in this case we
should have already been through the login process, and therefore the
Session collection item(login) should already be set.

Got it? :-)
Thnks again,

-BB
On 30 Aug 2003 12:56:19 GMT, "Evertjan."
<ex************ **@interxnl.net > wrote:
>Brian Burgess wrote on 30 aug 2003 in
>microsoft.publ ic.inetserver.a sp.general:
>
>> It IS in the same session! .. the user is linking .. in fact this all
>> WAS working .. until I changed the code to only set the value of a
>> Session collection item IF that item did not already have a value.
>
>I think we would need to see that piece of code.


Jul 19 '05 #5
what is that advocacy doc about? and what exactly is underquoting?
i've been posting in newsgroups via OE for a couple of years, and have never
seen a thread advocating quoting below a post rather than above

jason

"Evertjan." <ex************ **@interxnl.net > wrote in message
news:Xn******** ************@19 4.109.133.29...
jason kennedy wrote on 30 aug 2003 in
microsoft.publi c.inetserver.as p.general:
On 30 Aug 2003 12:56:19 GMT, "Evertjan."
<ex************ **@interxnl.net > wrote:
>Brian Burgess wrote on 30 aug 2003 in
>microsoft.publ ic.inetserver.a sp.general:
>
>> It IS in the same session! .. the user is linking .. in fact this
>> all WAS working .. until I changed the code to only set the value
>> of a Session collection item IF that item did not already have a
>> value.
>
>I think we would need to see that piece of code.

"Brian Burgess" <bb********@hot mail.com> wrote in message
Well I tried two ways...
1st:
If (Session("login ") = Empty) Then
Session("login" ) = Request.Form("l ogin")
End If

2nd:
If (Session("login ") = "") Then
Session("login" ) = Request.Form("l ogin")
End If
I should also mention that the user could be transfered to this page
from some other pages .. in this case we would not have the
'Request.Form(" login")' available to us. HOWEVER, in this case we
should have already been through the login process, and therefore the
Session collection item(login) should already be set.

looks like a logical flaw
on your login page, it would be better to use this

If Request.Form("l ogin") <> "" then
Session("login" ) = true
End if

if the user comes from another page having already logged in, to check

if session("login" ) <> true then

else

end if


[first I would like to stress, please do not underquote
<http://www.xs4all.nl/%7ewijnands/nnq/nquote.html>]

Brian is right, but do not accept the login confirmation from clientside,
that can be attacked.

"If true = true then" is superfluous, so this is enough:
<%
If Session("logged in") Then
Response.redire ct "mainpage.a sp"
End If

If Lcase(Request.F orm("loginname" )) = "john" AND _
Request.Form("l oginpassword") = "QWERty" then
Session("logged in") = true
Response.redire ct "mainpage.a sp"
End If
Response.redire ct "loginpage. asp"
%>

=============== ===========

And on mainpage.asp and all other pages:

<%
If NOT Session("logged in") Then
Response.redire ct "loginpage. asp"
End If
%>

If you have far more than one name/password combination,
a database becomes usefull.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Jul 19 '05 #6
Ok I just tried the following:
If Request.Form("l ogin") <> "" then
Session("login" ) = Request.Form("l ogin")
End if

The Session item gets set correctly as before, but is still reset to
'Empty' once the user clicks the link to another page... any ideas?

Thanks

-bB
On Sat, 30 Aug 2003 17:15:15 +0100, "jason kennedy" <ja***@pinhut.c om>
wrote:
what is that advocacy doc about? and what exactly is underquoting?
i've been posting in newsgroups via OE for a couple of years, and have never
seen a thread advocating quoting below a post rather than above

jason

"Evertjan." <ex************ **@interxnl.net > wrote in message
news:Xn******* *************@1 94.109.133.29.. .
jason kennedy wrote on 30 aug 2003 in
microsoft.publi c.inetserver.as p.general:
>> On 30 Aug 2003 12:56:19 GMT, "Evertjan."
>> <ex************ **@interxnl.net > wrote:
>> >Brian Burgess wrote on 30 aug 2003 in
>> >microsoft.publ ic.inetserver.a sp.general:
>> >
>> >> It IS in the same session! .. the user is linking .. in fact this
>> >> all WAS working .. until I changed the code to only set the value
>> >> of a Session collection item IF that item did not already have a
>> >> value.
>> >
>> >I think we would need to see that piece of code.
>>
> "Brian Burgess" <bb********@hot mail.com> wrote in message
>> Well I tried two ways...
>> 1st:
>> If (Session("login ") = Empty) Then
>> Session("login" ) = Request.Form("l ogin")
>> End If
>>
>> 2nd:
>> If (Session("login ") = "") Then
>> Session("login" ) = Request.Form("l ogin")
>> End If
>>
>>
>> I should also mention that the user could be transfered to this page
>> from some other pages .. in this case we would not have the
>> 'Request.Form(" login")' available to us. HOWEVER, in this case we
>> should have already been through the login process, and therefore the
>> Session collection item(login) should already be set.
> looks like a logical flaw
> on your login page, it would be better to use this
>
> If Request.Form("l ogin") <> "" then
> Session("login" ) = true
> End if
>
> if the user comes from another page having already logged in, to check
>
> if session("login" ) <> true then
>
> else
>
> end if


[first I would like to stress, please do not underquote
<http://www.xs4all.nl/%7ewijnands/nnq/nquote.html>]

Brian is right, but do not accept the login confirmation from clientside,
that can be attacked.

"If true = true then" is superfluous, so this is enough:
<%
If Session("logged in") Then
Response.redire ct "mainpage.a sp"
End If

If Lcase(Request.F orm("loginname" )) = "john" AND _
Request.Form("l oginpassword") = "QWERty" then
Session("logged in") = true
Response.redire ct "mainpage.a sp"
End If
Response.redire ct "loginpage. asp"
%>

=============== ===========

And on mainpage.asp and all other pages:

<%
If NOT Session("logged in") Then
Response.redire ct "loginpage. asp"
End If
%>

If you have far more than one name/password combination,
a database becomes usefull.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)


Jul 19 '05 #7
jason kennedy wrote on 30 aug 2003 in
microsoft.publi c.inetserver.as p.general:
and what exactly is underquoting?
i've been posting in newsgroups via OE for a couple of years, and have
never seen a thread advocating quoting below a post rather than above


But that is what you were doing. You were quoting under your post. This
answer is topquoting.

It does not matter what programme ["OE"] you use, it is against netiquette
on usenet NG.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #8
How about the original question .. Any one have ideas?

thanks

-BB

On 30 Aug 2003 17:52:53 GMT, "Evertjan."
<ex************ **@interxnl.net > wrote:
jason kennedy wrote on 30 aug 2003 in
microsoft.publ ic.inetserver.a sp.general:
and what exactly is underquoting?
i've been posting in newsgroups via OE for a couple of years, and have
never seen a thread advocating quoting below a post rather than above


But that is what you were doing. You were quoting under your post. This
answer is topquoting.

It does not matter what programme ["OE"] you use, it is against netiquette
on usenet NG.


Jul 19 '05 #9
I figured this one out with everyones help along an article(2157) in
ASPFAQ.com. The trouble was my initial code AND related to an MS security
patch. A KB article(Q316112 ) describes it.

My code now is more or less it is like the following, and it is working
properly:

<%

Option Explicit
If (Request.Form(" loginName") <> "") Then

Session("loginN ame") = Request.Form("l oginName")

End If

Dim strLoginName

strLoginName = Session("loginN ame")

....

'Do your stuff here

....

%>

Thanks all,

-BB

"Brian Burgess" <bb********@hot mail.com> wrote in message
news:is******** *************** *********@4ax.c om...
Hi all,

Anyone know of any issues with setting the value of a Session object
to the value of a submitted form item via
'Session("mySes sionObj")=Reque st.Form("myFrmE lem")' ?

In my case the Session object gets set fine. But when the user links
to another page, the value of the session object is EMPTY.

thanks in advance..

-BB

Jul 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1640
by: bateman | last post by:
Hi, I have a rather puzzling problem, have asked the ASP experts at work with no joy and its driving me mad! I'll explain the steps in more detail below but the general problem is I am manually creating a datetime value in my asp pages that I am putting in a session. Now this isn't being passed from page to page while other session objects are. There is no reason I can see for this happening. The steps I am using are: page1.asp - A...
3
2425
by: Alex Stevens | last post by:
I'd already posted this in microsoft.public.dotnet.framework.windowsforms and microsoft.public.dotnet.framework.windowsforms.controls to no avail so apologies for the cross-posting. Hi, I'm writing a usercontrol which displays the typical two listboxes and the ability to move items from one to the other. The listboxes are populated with my custom objects (SwapItem), which simply
0
1326
by: Jack | last post by:
Hi, I have the following problem. I have a main data entry form which has a link to a detailed data entry form. The value of the link in the main form is the sum total of all the line items in the detailed form. The detailed form has fields to capture the individual line items like contracted service expense, travel expense etc. I am capturing the total of individual line items using session variables so
3
1426
by: Billy Horne | last post by:
Hi - I need to write a basic order page for our web site. It is very straight-forward, in that we don't need a whole "shopping cart" system. Instead we just need a list of products displayed with a quantity field, and when they submit the form it then collects payment info, then they submit again and it charges their card. I plan to use a third party component to handle the credit card charging so that should be pretty easy. My main...
0
1443
by: antonyliu2002 | last post by:
I am not new to programming, but I am new to VB .NET. I have a multiselect listbox like this: Please select your favorite fruit: Apple Banana Coconut Date
7
2048
by: Mr Newbie | last post by:
I have written a Custom Control Menu. Its fairly simple but it works well enough. In order to simplify things I decided to store the Menu1 custom control in Session. In the page load event below, it retreives the Menu from session and assigns its reference to Menu1. Within the Page_Load event I can see its internal values which have been retreived for each menu item and so it looks good. However, when the Render method is called of...
5
3004
by: James Vickers | last post by:
All, I am a bit of noob to ASP.NET, and I am writing some OO based pages to try and emerge myself into it, however, I have come across a problem that has me completely stumped! What I want to do is to take an object that I am using on one page, and pass it to another page - this, I believe is easily achievable with a session (yes, I know about Server.Transfer for form elements, but I want an Object based upon a class that I have...
6
2438
by: Kermit Piper | last post by:
Hello, I thought this should be easy, but... all I want to do is set the value of this state drop-down based on a session var I'm getting back from a redirect (from the processing page): <% tax = session("Tax") city = session("City") state = session("State") %>
4
3748
by: Nick Gilbert | last post by:
Hi, Is it possible to access the Session of an arbitary user from an aspx page? On an e-commerce site, I am notified of payment success via a callback from the payment server to an ASPX page on my system. I would like to be able to access the session of the user that submitted the order, and clear their basket. I don't really want to store their session in the database just to facilitate this.
0
9589
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9163
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7626
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6858
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5527
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4304
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.