1

in my webapp, using spring @scope : session i have made scope of bean as session. My problem is if i login as admin in one tab of browser to web app and login as normal user in another tab of browser the data are being shared amoung them. How to avoid this.

If i am using two different browsers the problem is not occurring. Kindly suggest where am i doing wrong.

I have placed

@scope session in all bean classes and controller classes

.

  • 2
    You can't (unless maybe incognito tab). That's just how browsers and cookies work. – Sotirios Delimanolis Sep 16 '14 at 03:32
  • thaks for reply....but here two users logged are with different roles, either i should redirect user to home page if they try login in another tab or role based login/functionality should be done.... any suggestions?? – user1987823 Sep 16 '14 at 03:39

1 Answers1

0

Try the following:

  • Force the creation of a new session on user login. Right now it may happen that when the second user logs in, the server reuses the existing cookie information and reuses the existing session.
  • If the previous hint didn't work, try disabling cookies in Spring in favor of URL rewrite. Check this post.
Community
  • 1
  • 1
Daniel Cerecedo
  • 6,071
  • 4
  • 38
  • 51