Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 4th, 2007, 02:21 AM
Friend of Wrox
 
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default session problem

my problem is:

i installed payment gateway in my application which in return do not pass me any values - just if it deduct money send user back to welcome page otherwise at unsuccess page.

when user comes back in welcome or unsucess page, i want to retain his member id ot username so that i can activate that user or deactivate user. when i put it in session, the sessoin value lost as my application is redirected to payment gateway web site and when it return to my application session values lost.

Please guide how to retain the values.


thanks......
__________________
thanks......
  #2 (permalink)  
Old October 4th, 2007, 02:27 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Quote:
quote:the sessoin value lost as my application is redirected to payment gateway web site and when it return to my application session values lost.
Is that an assumption? Or a test outcome?

AFAIK, if you're using cookies based sessions, you can safely go to another site, return to the initial page and still have a valid session.

If you are using session identifiers in the querystirng, then you're out of luck with that solution.

However, you can often instruct payment gateways to send some identifier, like an order number in the query string. You can then look up that number in your database and find the associated user again.

Finally, you can store data in a cookie. Not secure, but it might work for you.

Cheers,

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
  #3 (permalink)  
Old October 4th, 2007, 11:47 AM
Friend of Wrox
 
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

well as username is unique in my application can i pass username in cookies and based on that username i will activate user account.
i will try to look in msdn to for coding as i have not used it so far. if you know link please tell me.

thanks......
  #4 (permalink)  
Old October 4th, 2007, 11:50 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

You could store the username in a cookie, but as I said, this may be a security risk as others could potentially see and use the user name.

But have you confirmed sessions don't work for you? I am pretty sure they will....

And a "link to what" are you referring to?

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
  #5 (permalink)  
Old October 5th, 2007, 04:15 AM
Friend of Wrox
 
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

well i am not sure i am asking if i will store username only in cookie but in web site user have to provide password also with that username so i am thinking that if i store username only in cookie an dif any person read it then he may not be able to use web site as he donot have password. am i right?

yes i am sure sessions are not working. you said right.

link refer to a help page from where i can get code how to store values in cookies and read them.

thanks......
  #6 (permalink)  
Old October 5th, 2007, 05:04 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

 
Quote:
quote:well i am not sure i am asking if i will store username only in cookie but in web site user have to provide password also with that username so i am thinking that if i store username only in cookie an dif any person read it then he may not be able to use web site as he donot have password. am i right?
Yes, true. ALthough IMO it's still a security risk. Up to you though....
Quote:
quote:yes i am sure sessions are not working. you said right.
I don't believe that. Try this:

1. Create an ASPX page with this markup:
Code:
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<a href="http://www.google.com/">Go to Google</a>
2. In Code Behind add this:
Code:
Session["Test"] = "Something";
Label1.Text = Session.SessionID;
(Notice it's important to assign something to Session state first.
3. Run the page. Note the Session ID
4. Click the link to go to Google
5. Click the back button
6. Press Ctrl+F5 to refresh the page a couple of times.

The ID will be the same as in step 3.
Quote:
quote:link refer to a help page from where i can get code how to store values in cookies and read them.
The best link is www.google.com Searching for Cookies ASP.NET should give you plenty results to work with.

Imar





---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
  #7 (permalink)  
Old October 5th, 2007, 05:42 AM
Friend of Wrox
 
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

well Imar
i am going to try in my application again.
and let you know.

thanks......
  #8 (permalink)  
Old October 5th, 2007, 06:56 AM
Friend of Wrox
 
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

well imar i am sorry Man
you were confident but right. after deducting money from payment gateway web site , when it comes to my web site-session retains
Thanks to all help.

thanks......
  #9 (permalink)  
Old October 5th, 2007, 12:47 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Quote:
quote:you were confident but right
It's easy to be confident if you're right.... ;)

Glad it's working now.

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
  #10 (permalink)  
Old October 6th, 2007, 04:06 AM
Friend of Wrox
 
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

You are Right :)

thanks......
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Session Out Problem kasipandian J2EE 3 March 21st, 2008 03:35 PM
Session problem abdulweb General .NET 3 August 27th, 2007 08:01 PM
session problem smsone PHP Databases 1 May 17th, 2006 05:34 PM
session and cookie problem (empty session file) msincan BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 February 27th, 2005 05:31 PM



All times are GMT -4. The time now is 12:22 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.